Package org.jpokemon.server

Examples of org.jpokemon.server.Message


      for (ActionSet actionSet : entity.getActionSets("step")) {
        try {
          actionSet.execute(player);
        }
        catch (ServiceException e) {
          PlayerManager.pushMessage(player, new Message("error", e.getMessage()));
        }
      }
    }

    player.setLocation(location);
View Full Code Here


    for (ActionSet actionSet : entity.getActionSets("interact")) {
      try {
        actionSet.execute(player);
      }
      catch (ServiceException e) {
        PlayerManager.pushMessage(player, new Message("error", e.getMessage()));
      }
    }
  }
View Full Code Here

    synchronized (pendingList) {
      pendingList.add(player.id());
    }

    PlayerManager.pushMessage(player, new Message("Friend request sent"));
    PlayerManager.pushMessage(otherPlayer, new Message("New friend request"));
    PlayerManager.pushJson(otherPlayer, generateJson(otherPlayer));
  }
View Full Code Here

      otherPlayer.addFriend(player.id());

      pendingList.remove(otherPlayer.id());
    }

    Message message = new Message("Friend request accepted");
    PlayerManager.pushMessage(player, message);
    PlayerManager.pushMessage(otherPlayer, message);
    PlayerManager.pushJson(otherPlayer, generateJson(otherPlayer));
  }
View Full Code Here

  private void blockOtherPlayer(Player player, Player otherPlayer) {
    player.addBlocked(otherPlayer.id());
    otherPlayer.removeFriend(player.id());

    PlayerManager.pushMessage(player, new Message("Player blocked"));
  }
View Full Code Here

      int team = json.getInt("team");

      if (!lobby.isConfiguring()) { return; }

      if (!PlayerManager.playerIsLoggedIn(otherPlayerName)) {
        Message message = new Message("'" + otherPlayerName + "' not found");
        PlayerManager.pushMessage(player, message);
        return;
      }

      lobby.addPlayer(otherPlayerName, team);
View Full Code Here

      PlayerManager.addActivity(player, battle);
    }
  }

  private void pushLobbyToPlayers(Lobby lobby, boolean sendNewRequestMessage) {
    Message message = new Message("New battle request");
    JSONObject lobbyJson = generateJson(lobby);

    for (List<String> team : lobby.getTeams()) {
      for (String name : team) {
        Player player = PlayerManager.getPlayer(name);
View Full Code Here

TOP

Related Classes of org.jpokemon.server.Message

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.