Examples of GameEvent


Examples of games.stendhal.server.core.engine.GameEvent

          }
        }
      }

      if (type != null) {
        new GameEvent(player.getName(), SUMMONAT, changed.getName(), slotName, type).raise();
        final Item item = manager.getItem(type);

        if (action.has(AMOUNT) && (item instanceof StackableItem)) {
          ((StackableItem) item).setQuantity(action.getInt(AMOUNT));
        }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

  @Override
  public void perform(final Player player, final RPAction action) {

    if (player.isTeleclickEnabled()) {
      player.setTeleclickEnabled(false);
      new GameEvent(player.getName(), TELECLICKMODE, "off").raise();
    } else {
      player.setTeleclickEnabled(true);
      new GameEvent(player.getName(), TELECLICKMODE, "on").raise();
    }
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      }
     
      final String message = player.getTitle() + " answers " + Grammar.suffix_s(action.get(TARGET))
          + " support question: " + reply;

      new GameEvent(player.getName(), SUPPORTANSWER, action.get(TARGET), reply).raise();
      if (supported != null) {

        supported.sendPrivateText(NotificationType.SUPPORT, "Support (" + player.getTitle() + ") tells you: " + reply + " \nIf you wish to reply, use /support.");
        supported.notifyWorldAboutChanges();
        SingletonRepository.getRuleProcessor().sendMessageToSupporters(message);
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      //emote actions are treated as normal chat actions
      //on the client side, !me is replaced with the name
      final String text = "!me " + action.get(TEXT);
      player.put("text", text);
      new GameEvent(player.getName(), "chat", null, Integer.toString(text.length()), text.substring(0, Math.min(text.length(), 1000))).raise();

      player.notifyWorldAboutChanges();
      SingletonRepository.getRuleProcessor().removePlayerText(player);
    }
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

        DAORegister.get().get(AccountDAO.class).addBan(username, reason, expire);
        player.sendPrivateText("You have banned account " + username + " (character: " + bannedName + ") until " + expireStr + " for: " + reason);

        // logging
        logger.info(player.getName() + " has banned  account " + username + " (character: " + bannedName + ") until " + expireStr + " for: " + reason);
        new GameEvent(player.getName(), "ban",  bannedName, expireStr, reason).raise();
       
        SingletonRepository.getRuleProcessor().sendMessageToSupporters("JailKeeper",
            player.getName() + " banned account " + username + " (character: " + bannedName + ") until " + expireStr
            + ". Reason: " + reason  + ".");
      } catch (SQLException e) {
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      }

      // remove duplicate buddy names
      for(String duplicateName : duplicates) {
        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);
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

    }

    // remove invalid buddy names
    for(String invalidName : oldNames) {
      if (player.removeBuddy(invalidName)) {
        new GameEvent(player.getName(), "buddy", "remove", invalidName).raise();
      }
    }

    // add renamed buddy entries
    for(String newName : newNames) {
      final Player buddy = SingletonRepository.getRuleProcessor().getPlayer(newName);

      if (player.addBuddy(newName, buddy!=null && !buddy.isGhost())) {
        new GameEvent(player.getName(), "buddy", "add", newName).raise();
      }
    }
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

    if (!senderName.equals(receiverName)) {
      player.sendPrivateText("You tell " + receiverName + ": " + text);
    }

    receiver.setLastPrivateChatter(senderName);
    new GameEvent(player.getName(), "chat", receiverName, Integer.toString(text.length()), text.substring(0, Math.min(text.length(), 1000))).raise();
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      for(String name : player.getBuddies()) {
        // search for buddy names using case insensitive matching
        if (name.equalsIgnoreCase(who)) {
          if (player.removeBuddy(name)) {
            new GameEvent(player.getName(), "buddy", "remove", name).raise();
            player.sendPrivateText(name + " was removed from your buddy list.");
 
            // TEMP! superseded by /unignore
            player.removeIgnore(name);
            ++removed;
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      final StendhalRPZone zone = teleported.getZone();
      final int x = teleported.getX();
      final int y = teleported.getY();

      player.teleport(zone, x, y, null, player);
      new GameEvent(player.getName(), TELEPORTTO, action.get(TARGET), zone.getName(), Integer.toString(x), Integer.toString(y)).raise();
    }
  }
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.