Package simpleserver.command

Examples of simpleserver.command.ServerCommand


    if (tokens.length > 1) {
      int idx = command.indexOf(tokens[0]) + tokens[0].length() + 1;
      rest = command.substring(idx);
    }

    ServerCommand serverCommand = server.getCommandParser().getServerCommand(tokens[0]);
    if ((serverCommand != null) && !(serverCommand instanceof InvalidCommand)) {
      serverCommand.execute(server, command, feedback);
    }
    if (serverCommand == null || serverCommand.shouldPassThroughToConsole(server)) {
      server.runCommand(tokens[0], rest);
    }
  }
View Full Code Here


    server.addOutputLine(line);
    System.out.println(line);
  }

  public boolean parseCommand(String line) {
    ServerCommand command = server.getCommandParser().getServerCommand(line.split(" ")[0]);
    if ((command != null) && !(command instanceof InvalidCommand)) {
      command.execute(server, line, feedback);
      return !command.shouldPassThroughToConsole(server);
    }
    return false;
  }
View Full Code Here

    for (String t : tokens) {
      args += t + " ";
    }
    args = args.substring(0, args.length() - 1);

    ServerCommand command = server.getCommandParser().getServerCommand(cmd);
    if (command != null) {
      server.runCommand(cmd, args);
    }

  }
View Full Code Here

TOP

Related Classes of simpleserver.command.ServerCommand

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.