Examples of DBCommand


Examples of marauroa.server.db.command.DBCommand

        player.removeBuddy(duplicateName);
        new GameEvent(player.getName(), "buddy", "remove", duplicateName).raise();
      }

      // invoke the check for valid character names
      DBCommand command = new QueryCanonicalCharacterNamesCommand(player, player.getBuddies());
      DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
    }
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

    if (!player.getChatBucket().checkAndAdd()) {
      return;
    }
    if (action.has(TARGET) && action.has(TEXT)) {
      String message = action.get(TEXT);
      DBCommand command = new StoreMessageCommand(player.getName(), action.get(TARGET), message, "P");
      DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
    }
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

      return;
    }

    final String who = action.get(TARGET);

    DBCommand command = new QueryCanonicalCharacterNamesCommand(player, Arrays.asList(who));
    DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
    TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

  public SignFromHallOfFameLoader(Sign sign, String introduction, String fametype, int max, boolean ascending, boolean lineBreaks) {
    this.sign = sign;
    this.introduction = introduction;
    this.handle = new ResultHandle();
    this.lineBreaks = lineBreaks;
    DBCommand command = new ReadCharactersFromHallOfFameCommand(fametype, max, ascending);
    DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

    if (action.has("source") && action.has(TARGET) && action.has(TEXT)) {
     
      String message = action.get(TEXT);
     
      DBCommand command = new StoreMessageCommand(action.get("source"), action.get(TARGET), message, "P");
      DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
    }
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

public class ReadAchievementsOnLogin implements LoginListener, TurnListener {
 
  private ResultHandle handle = new ResultHandle();
 
  public void onLoggedIn(Player player) {
    DBCommand command = new ReadAchievementsForPlayerCommand(player);
    DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
    TurnNotifier.get().notifyInTurns(1, new TurnListenerDecorator(this));
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

  private static final Logger LOGGER = Logger.getLogger(ReadPostmanMessages.class);
 
  private ResultHandle handle = new ResultHandle();
 
  public void readMessages(final Player player) {
    DBCommand command = new GetPostmanMessagesCommand(player);
    DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
    // wait one turn so that the messages come after any login messages
    TurnNotifier.get().notifyInTurns(1, new TurnListenerDecorator(this));
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

    this.event = event;
    this.params = params;
  }

  public void raise() {
    DBCommand command = new LogGameEventCommand(source, event, params);
    DBCommandQueue.get().enqueue(command);
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

public class UpdatePendingAchievementsOnLogin implements LoginListener, TurnListener {
 
  private ResultHandle handle = new ResultHandle();
 
  public void onLoggedIn(Player player) {
    DBCommand command = new ReadPendingAchievementDetailsCommand(player);
    DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
    TurnNotifier.get().notifyInTurns(1, new TurnListenerDecorator(this));
  }
View Full Code Here

Examples of marauroa.server.db.command.DBCommand

    updateItemLoots(player, command.getDetails("item.set.red"));

    // Could also check for reached achievements here. This is also checked on login but the order may vary due to the async access?
   
    // delete the entries. We don't need feedback
    DBCommand deletecommand = new DeletePendingAchievementDetailsCommand(player);
    DBCommandQueue.get().enqueue(deletecommand);
   
  }
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.