Package net.bnubot.core.commands

Examples of net.bnubot.core.commands.AccountDoesNotExistException


        if(params.length < 3)
          throw new InvalidUseException();

        Account rsTargetAccount = Account.get(params[1]);
        if(rsTargetAccount == null)
          throw new AccountDoesNotExistException(params[1]);

        params[1] = rsTargetAccount.getName();
        Mail.send(commanderAccount, rsTargetAccount, params[2]);
        user.sendChat("Mail queued for delivery to " + rsTargetAccount.getName(), whisperBack);
      } else if(params[0].equals("read")
View Full Code Here


      return;
    }

    Account rsSubject = Account.get(params[0]);
    if(rsSubject == null)
      throw new AccountDoesNotExistException(params[0]);
    params[0] = rsSubject.getName();

    Account rsTarget = Account.get(params[1]);
    if(rsTarget == null)
      throw new AccountDoesNotExistException(params[1]);
    params[1] = rsTarget.getName();

    String recursive = params[0];

    Account cb = rsTarget;
View Full Code Here

   */
  public static Account createAccount(String accountName, int targetAccess, Account recruiter, BNLogin subject)
  throws AccountDoesNotExistException {
    Account rsSubjectAccount = Account.get(accountName);
    if(rsSubjectAccount != null)
      throw new AccountDoesNotExistException("That account already exists!");

    try {
      rsSubjectAccount = Account.create(accountName, Rank.get(0), recruiter);
    } catch(Exception e) {}

    if(rsSubjectAccount == null)
      throw new AccountDoesNotExistException("Failed to create account [" + accountName + "] for an unknown reason");

    subject.setAccount(rsSubjectAccount);
    rsSubjectAccount.setRank(Rank.get(targetAccess));

    try {
      rsSubjectAccount.updateRow();
      return rsSubjectAccount;
    } catch(Exception e) {
      throw new AccountDoesNotExistException(e.getMessage());
    }
  }
View Full Code Here

    Account newAccount = null;
    if(params.length == 2) {
      newAccount = Account.get(params[1]);
      if(newAccount == null)
        throw new AccountDoesNotExistException(params[1]);
    }

    rsSubject.setAccount(newAccount);
    rsSubject.updateRow();
View Full Code Here

    if((targetAccount != null) && !targetAccount.equals(rsSubjectAccount))
      throw new CommandFailedWithDetailsException("The Account [" + targetAccount.getName() + "] already exists!");

    if(rsSubjectAccount == null)
      throw new AccountDoesNotExistException(params[0]);

    params[0] = rsSubjectAccount.getName();

    try {
      rsSubjectAccount.setName(params[1]);
View Full Code Here

        subjectAccount = commanderAccount;
        output = "You have recruited: ";
      } else {
        subjectAccount = Account.get(params[0]);
        if(subjectAccount == null)
          throw new AccountDoesNotExistException(params[0]);
        output = subjectAccount.getName();
        output += " has recruited: ";
      }

      if(subjectAccount.getRecruits().size() == 0)
View Full Code Here

        subject = Account.get(user);
      else
        subject = Account.get(params[0]);

      if(subject == null)
        throw new AccountDoesNotExistException(params[0]);

      long wins[] = subject.getWinsLevels(GlobalSettings.recruitTagPrefix, GlobalSettings.recruitTagSuffix);
      long recruitScore = subject.getRecruitScore(GlobalSettings.recruitAccess);
      Date ts = subject.getLastRankChange();
      String timeElapsed;
View Full Code Here

TOP

Related Classes of net.bnubot.core.commands.AccountDoesNotExistException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.