Package net.bnubot.core.commands

Examples of net.bnubot.core.commands.CommandRunnable


  private static void initializeCommands() {
    if(commandsInitialized)
      return;
    commandsInitialized = true;

    Profile.registerCommand("login", new CommandRunnable() {
    @Override
    public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
    throws Exception {
      findThis(source, GameTracker.class);
      source.sendFriendsList();
      source.sendChat("/f a " + user.getFullAccountName());
    }});
    Profile.registerCommand("logout", new CommandRunnable() {
    @Override
    public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
    throws Exception {
      findThis(source, GameTracker.class);
      source.sendFriendsList();
View Full Code Here


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

    CommandRunnable cr = Profile.getCommand(command);
    if(cr == null) {
      source.dispatchRecieveError("Command " + command + " has no associated runnable");
      throw new CommandDoesNotExistException(command);
    }

    String[] params = null;
    if(param != null)
      params = param.split(" ");

    cr.run(source,
        user,
        param,
        params,
        whisperBack,
        commanderAccount,
View Full Code Here

  public static void initializeCommands() {
    if(commandsInitialized)
      return;
    commandsInitialized = true;

    Profile.registerCommand("lockdown", new CommandRunnable() {
      @Override
      public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
      throws Exception {
        LockdownEventHandler leh = EventHandler.findThis(source, LockdownEventHandler.class);
        if(leh == null) {
View Full Code Here

  private static void initializeCommands() {
    if(commandsInitialized)
      return;
    commandsInitialized = true;

    Profile.registerCommand("music", new CommandRunnable() {
      @Override
      public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
      throws Exception {
        MusicController mc = MusicControllerFactory.getMusicController();
        user.sendChat(mc.getCurrentlyPlaying(), whisperBack);
      }});
    Profile.registerCommand("pause", new CommandRunnable() {
      @Override
      public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
      throws Exception {
        MusicController mc = MusicControllerFactory.getMusicController();
        mc.pause();
      }});
    Profile.registerCommand("play", new CommandRunnable() {
      @Override
      public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
      throws Exception {
        MusicController mc = MusicControllerFactory.getMusicController();
        mc.play();
View Full Code Here

  public static void initializeCommands() {
    if(commandsInitialized)
      return;
    commandsInitialized = true;

    Profile.registerCommand("trivia", new CommandRunnable() {
      @Override
      public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
      throws Exception {
        TriviaEventHandler teh = EventHandler.findThis(source, TriviaEventHandler.class);
        if(teh == null) {
View Full Code Here

*/
public final class CommandWhoami implements CommandRunnable {
  @Override
  public void run(Connection source, BNetUser user, String param, String[] params, boolean whisperBack, Account commanderAccount, boolean superUser)
  throws Exception {
    CommandRunnable whois = Profile.getCommand("whois");
    String[] newParams = new String[] {user.getShortLogonName()};
    whois.run(source, user, newParams[0], newParams, whisperBack, commanderAccount, superUser);
  }
View Full Code Here

TOP

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

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.