Package marauroa.server.db.command

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


      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

  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

    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

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

  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

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

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

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

    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

  public NotifyPlayerAboutHallOfFamePoints(SpeakerNPC npc, String playerName, String fametype, String questSlot) {
    this.npc = npc;
    this.playerName = playerName;
    this.handle = new ResultHandle();
    this.questSlot = questSlot;
    DBCommand command = new ReadHallOfFamePointsCommand(playerName, fametype);
    DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
  }
View Full Code Here

TOP

Related Classes of marauroa.server.db.command.DBCommand

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.