Examples of TurnListenerDecorator


Examples of games.stendhal.server.core.events.TurnListenerDecorator

    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 games.stendhal.server.core.events.TurnListenerDecorator

   */
  public void onTurnReached(int currentTurn) {
    QueryCanonicalCharacterNamesCommand checkcommand = DBCommandQueue.get().getOneResult(QueryCanonicalCharacterNamesCommand.class, handle);

    if (checkcommand == null) {
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
      return;
    }

    Player player = checkcommand.getPlayer();

View Full Code Here

Examples of games.stendhal.server.core.events.TurnListenerDecorator

     
      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 games.stendhal.server.core.events.TurnListenerDecorator

   */
  public void onTurnReached(int currentTurn) {
    StoreMessageCommand checkcommand = DBCommandQueue.get().getOneResult(StoreMessageCommand.class, handle);
   
    if (checkcommand == null) {
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
      return;
    }

    boolean characterExists = checkcommand.targetCharacterExists();
    String source = checkcommand.getSource();
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListenerDecorator

  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 games.stendhal.server.core.events.TurnListenerDecorator

  }

  public void onTurnReached(int currentTurn) {
    ReadAchievementsForPlayerCommand command = DBCommandQueue.get().getOneResult(ReadAchievementsForPlayerCommand.class, handle);
    if (command == null) {
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
      return;
    }
    Player p = command.getPlayer();
    Set<String> identifiers = command.getIdentifiers();
    p.initReachedAchievements();
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListenerDecorator

 
  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 games.stendhal.server.core.events.TurnListenerDecorator

   */
  public void onTurnReached(int currentTurn) {
    GetPostmanMessagesCommand command = DBCommandQueue.get().getOneResult(GetPostmanMessagesCommand.class, handle);
   
    if (command == null) {
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
      return;
    }

    List<ChatMessage> messages = command.getMessages();
    Player player = command.getPlayer();
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListenerDecorator

  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 games.stendhal.server.core.events.TurnListenerDecorator

  public void onTurnReached(int currentTurn) {
    ReadPendingAchievementDetailsCommand command = DBCommandQueue.get().getOneResult(ReadPendingAchievementDetailsCommand.class, handle);

    if (command == null) {
      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
      return;
    }
    Player player = command.getPlayer();
   
    updateElfPrincessAchievement(player, command.getDetails("quest.special.elf_princess.0025"));
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.