Examples of InvalidUseException


Examples of net.bnubot.core.commands.InvalidUseException

  @Override
  public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
  throws Exception {
    try {
      if((params == null) || (params.length != 1))
        throw new InvalidUseException();

      Account rsSubjectAccount = Account.get(params[0]);
      if(rsSubjectAccount == null) {
        BNetUser bnSubject = source.getCreateBNetUser(params[0], user);
View Full Code Here

Examples of net.bnubot.core.commands.InvalidUseException

  @Override
  public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
  throws Exception {
    try {
      if((params == null) || (params.length < 1) || (params.length > 2))
        throw new InvalidUseException();

      int access;
      try {
        access = Integer.parseInt(params[0]);
      } catch(NumberFormatException e) {
        throw new InvalidUseException();
      }

      int accessUpper = access;
      if(params.length > 1)
        try {
          accessUpper = Integer.parseInt(params[1]);
        } catch(NumberFormatException e) {
          throw new InvalidUseException();
        }

      String out = "Accounts found: ";
      boolean first = true;
      for(int i = access; i <= accessUpper; i++) {
View Full Code Here

Examples of net.bnubot.core.commands.InvalidUseException

  @Override
  public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
  throws Exception {
    try {
      if(params == null)
        throw new InvalidUseException();
      if(params.length != 1)
        throw new InvalidUseException();

      Account subjectAccount = CommandEventHandler.findOrCreateAccount(source, user, commanderAccount, params[0], 0);

      int targetAccess = subjectAccount.getAccess() + 1;
      CommandEventHandler.setAccountAccess(user, commanderAccount, subjectAccount, targetAccess, superUser, whisperBack);
View Full Code Here

Examples of net.bnubot.core.commands.InvalidUseException

    if(commanderAccount != null)
      commanderAccess = commanderAccount.getAccess();

    try {
      if(params == null)
        throw new InvalidUseException();
      if(params.length != 1)
        throw new InvalidUseException();

      List<Command> commands;
      if(params[0].equals("all"))
        commands = Command.getCommands(commanderAccess);
      else
View Full Code Here

Examples of net.bnubot.core.commands.InvalidUseException

  @Override
  public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
  throws Exception {
    try {
      if((params != null) && (params.length != 1))
        throw new InvalidUseException();


      Account subjectAccount = null;
      String output = null;
      if(params == null) {
View Full Code Here

Examples of net.bnubot.core.commands.InvalidUseException

  @Override
  public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
  throws Exception {
    try {
      if(params == null)
        throw new InvalidUseException();
      if(params.length != 2)
        throw new InvalidUseException();

      int newRank = 0;
      if(params[1].compareToIgnoreCase("peon") == 0)
        newRank = 1;
      else if(params[1].compareToIgnoreCase("grunt") == 0)
        newRank = 2;
      else if(params[1].compareToIgnoreCase("shaman") == 0)
        newRank = 3;
      else
        try {
          newRank = Integer.valueOf(params[1]);
        } catch(Exception e) {}

      if((newRank < 1) || (newRank > 3))
        throw new InvalidUseException();

      // TODO: validate that params[0] is in the clan
      source.sendClanRankChange(
          CookieUtility.createCookie(new CommandResponseCookie(user, whisperBack)),
          params[0],
View Full Code Here

Examples of net.bnubot.core.commands.InvalidUseException

  @Override
  public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
  throws Exception {
    try {
      if((params != null) && (params.length != 1))
        throw new InvalidUseException();

      Account subject;
      if(params == null)
        subject = Account.get(user);
      else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.