Package games.stendhal.server.core.engine.dbcommand

Examples of games.stendhal.server.core.engine.dbcommand.ReadPendingAchievementDetailsCommand


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


    DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
    TurnNotifier.get().notifyInTurns(1, new TurnListenerDecorator(this));
  }

  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"));
    updateItemLoots(player, command.getDetails("item.set.black"));
    updateItemLoots(player, command.getDetails("item.set.chaos"));
    updateItemLoots(player, command.getDetails("item.set.shadow"));
    updateItemLoots(player, command.getDetails("item.set.golden"));
    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);
View Full Code Here

TOP

Related Classes of games.stendhal.server.core.engine.dbcommand.ReadPendingAchievementDetailsCommand

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.