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

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


    final String playername = player.getName();
    final Player playerNow = SingletonRepository.getRuleProcessor().getPlayer(playername);
    if (playerNow != null) {
      playerNow.sendPrivateText(source + " tells you:\n" + message);
    } else {
      DBCommandQueue.get().enqueue(new StoreMessageCommand(source, playername, message, "N"));
    }
  }
View Full Code Here


        supported.notifyWorldAboutChanges();
        SingletonRepository.getRuleProcessor().sendMessageToSupporters(message);
       
      } else {
        // that player is not logged in. Do they exist at all or are they just offline? Try sending a message with postman.
        DBCommand command = new StoreMessageCommand(player.getName(), action.get(TARGET), "In answer to your support question:\n" + reply + " \nIf you wish to reply, use /support.", "S");
        DBCommandQueue.get().enqueueAndAwaitResult(command, handle);
        TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
      }
    }
  }
View Full Code Here

   * Completes handling the supportanswer action.
   *
   * @param currentTurn ignored
   */
  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 adminName = checkcommand.getSource();
    String target = checkcommand.getTarget();
    String supportmessage = checkcommand.getMessage();
   
    final Player admin = SingletonRepository.getRuleProcessor().getPlayer(adminName);
   
    if(!characterExists) {
        if (admin != null) {
View Full Code Here

    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

   * Notifies the player who sent the message of the outcome
   *
   * @param currentTurn ignored
   */
  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();
    String target = checkcommand.getTarget();
   
    final Player sourceplayer = SingletonRepository.getRuleProcessor().getPlayer(source);


    if (sourceplayer != null) {
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

   * Completes handling the store message action
   *
   * @param currentTurn ignored
   */
  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();
    String target = checkcommand.getTarget();
   
    final Player sourceplayer = SingletonRepository.getRuleProcessor().getPlayer(source);


    if (sourceplayer != null) {
View Full Code Here

  private void sendMessage(String player, StringBuilder message) {
   
    logger.debug("sending a notice to '" + player + "': " + message.toString());
   
    // there is an npc action to send the message but this is all we want to do here.
    DBCommandQueue.get().enqueue(new StoreMessageCommand("Harold", player, message.toString(), "N"))
  }
View Full Code Here

        earningToFetchMessage.append("Your ");
        earningToFetchMessage.append(itemname);
        earningToFetchMessage.append(" was sold. You can now fetch your earnings from me.");

        logger.debug("sending a notice to '" + offer.getOfferer() + "': " + earningToFetchMessage.toString());
        DBCommandQueue.get().enqueue(new StoreMessageCommand("Harold", offer.getOfferer(), earningToFetchMessage.toString(), "N"));

        npc.say("Thanks.");
        // Obsolete the offers, since the list has changed
        ((MarketManagerNPC) npc.getEntity()).getOfferMap().clear();
      } else {
View Full Code Here

    this.message = message;   
  }


  public void fire(Player player, Sentence sentence, EventRaiser npc) {
    DBCommandQueue.get().enqueue(new StoreMessageCommand(npcName, player.getName(), message, "N"));
  }
View Full Code Here

TOP

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

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.