Package de.creepsmash.common.messages.server

Examples of de.creepsmash.common.messages.server.HighscoreResponseMessage


  /**
   * @param offset
   * @return the actual HighscoreResponseMessage to send to clients.
   */
  public HighscoreResponseMessage getHighscoreMessage(int offset) {
    HighscoreResponseMessage highscoreResponseMessage = new HighscoreResponseMessage();
    Set<HighscoreEntry> highscoreEntries = new HashSet<HighscoreEntry>();

    Set<Player> players = AuthenticationService.getPlayers(offset);
    for (Player player : players) {
      HighscoreEntry highscoreEntry = new HighscoreEntry();
      highscoreEntry.setPlayerName(player.getName());
      highscoreEntry.setPoints(player.getElopoints() - 500);
      highscoreEntry.setOldPoints(player.getOldElopoints() - 500);
      highscoreEntries.add(highscoreEntry);
    }
    highscoreResponseMessage.setHighscoreEntries(highscoreEntries);
    return highscoreResponseMessage;
  }
View Full Code Here


      messageObject = new ErrorMessage();
    } else if (GamesMessage.PATTERN.matcher(messageString).matches()) {
      messageObject = new GamesMessage();
    } else if (HighscoreResponseMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new HighscoreResponseMessage();
    } else if (JoinGameResponseMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new JoinGameResponseMessage();
    } else if (LoginResponseMessage.PATTERN.matcher(messageString)
        .matches()) {
View Full Code Here

TOP

Related Classes of de.creepsmash.common.messages.server.HighscoreResponseMessage

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.