Package net.bnubot.db

Examples of net.bnubot.db.Account


      throw new CommandDoesNotExistException(command);

    //Reset the command to the case in the database
    command = rsCommand.getName();

    Account commanderAccount = Account.get(user);
    if(!superUser) {
      int commanderAccess = 0;
      if(commanderAccount != null)
        commanderAccess = commanderAccount.getAccess();

      int requiredAccess = rsCommand.getAccess();
      if(commanderAccess < requiredAccess)
        throw new InsufficientAccessException("(" + commanderAccess + "/" + requiredAccess + ")", commanderAccess > 0);
    }
View Full Code Here


    // Shitlist the user
    try {
      BNLogin bnlUser = BNLogin.get(user);
      if((bnlUser != null) && (bnlUser.getAccount() == null)) {
        // The user has no account; shitlist him!
        Account account = Account.create(user.getFullAccountName(), Rank.getMin(), null);
        bnlUser.setAccount(account);
        bnlUser.updateRow();
      }
    } catch(Exception e) {
      Out.exception(e);
View Full Code Here

    if(context == null)
      return shortLogonName;

    String shortPrettyName = shortLogonName;
    try {
      Account account = Account.get(this);
      if(account != null) {
        String name = account.getName();
        if(name != null)
          shortPrettyName = name;

        Rank rank = account.getRank();
        if(rank != null) {
          String prefix = rank.getShortPrefix();
          if(prefix == null)
            prefix = rank.getPrefix();
          if(prefix != null)
View Full Code Here

    if(context == null)
      return shortLogonName;

    String prettyName = shortLogonName;
    try {
      Account account = Account.get(this);
      if(account != null) {
        String name = account.getName();
        if(name != null)
          prettyName = name + " (" + prettyName + ")";

        Rank rank = account.getRank();
        if(rank != null) {
          String prefix = rank.getPrefix();
          if(prefix != null)
            prettyName = prefix + " " + prettyName;
        }
View Full Code Here

    if(context == null)
      return shortLogonName;

    String prettyName = shortLogonName;
    try {
      Account account = Account.get(this);
      if(account != null) {
        String name = account.getName();
        if(name != null)
          prettyName = name + " (" + prettyName + ")";
      }
    } catch(Exception e) {
      Out.exception(e);
View Full Code Here

    if(context == null)
      return shortLogonName;

    String prettyName = shortLogonName;
    try {
      Account account = Account.get(this);
      if(account != null) {
        String name = account.getName();
        if(name != null)
          prettyName = name;
      }
    } catch(Exception e) {
      Out.exception(e);
View Full Code Here

    this.flags = flags;

    ObjectContext context = DatabaseContext.getContext();
    if(context != null)
      try {
        Account account = Account.get(this);
        if(account != null)
          this.flags |= account.getFlagSpoof();
      } catch(Exception e) {
        Out.exception(e);
      }
  }
View Full Code Here

   * @throws IllegalStateException <code>if(con == null)</code>
   */
  public void sendChat(String text, boolean whisperBack) {
    int priority = 0;

    Account account = Account.get(this);
    if(account != null)
      priority = account.getAccess();

    sendChat(text, whisperBack, priority);
  }
View Full Code Here

        targetAccess = Integer.parseInt(params[1]);
      } catch(NumberFormatException e) {
        throw new InvalidUseException();
      }

      Account subjectAccount = CommandEventHandler.findOrCreateAccount(source, user, commanderAccount, params[0], targetAccess);
      CommandEventHandler.setAccountAccess(user, commanderAccount, subjectAccount, targetAccess, superUser, whisperBack);
    } catch(InvalidUseException e) {
      user.sendChat("Use: %trigger%add <account> <access>", whisperBack);
    }
  }
View Full Code Here

      logins.add(login);
    }

    String account = accountName[0].getText();
    Account a = Account.get(account);
    if(a == null)
      a = Account.create(account, Rank.getMax(), null);
    a.updateRow();
    for(String l : logins) {
      BNLogin bnl = BNLogin.getCreate(new BNetUser(l));
      bnl.setAccount(a);
      bnl.updateRow();
    }
View Full Code Here

TOP

Related Classes of net.bnubot.db.Account

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.