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

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


        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


      TurnNotifier.get().notifyInTurns(0, new TurnListenerDecorator(this));
    }
  }

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

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

    Collection<String> queriedNames = checkCommand.getQueriedNames();
    Collection<String> validNames = checkCommand.getValidNames();

    // compute the difference between the two name sets
    Collection<String> oldNames = new HashSet<String>();
    oldNames.addAll(queriedNames);
    for(String name : validNames) {
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

   * Completes handling the buddy action.
   *
   * @param currentTurn ignored
   */
  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();

    Collection<String> queriedNames = checkcommand.getQueriedNames();
    String who = queriedNames.iterator().next(); // We know, we queried exactly one character.

    Collection<String> validNames = checkcommand.getValidNames();
    if (validNames.isEmpty()) {
      player.sendPrivateText(NotificationType.ERROR, "Sorry, " + who + " could not be found.");
      return;
    }

View Full Code Here

TOP

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

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.