HighscoreRequestMessage requestMessage = (HighscoreRequestMessage) message;
this.getClient().send(new HighscoreService().
getHighscoreMessage(requestMessage.getStart()));
return this;
} else if (message instanceof CreateGameMessage) {
Game game = this.lobby.createGame(this.getClient(),
((CreateGameMessage) message).getGameName(),
((CreateGameMessage) message).getMapId(),
((CreateGameMessage) message).getMaxPlayers(),
((CreateGameMessage) message).getPasswort(),
((CreateGameMessage) message).getMaxEloPoints(),
((CreateGameMessage) message).getMinEloPoints());
if (game == null) {
authenticatedStateLogger.error("failed to create game "
+ ((CreateGameMessage) message).getGameName());
return this;
} else {
return new InGameState(this.getOutQueue(), this.getClient(),
game.getQueue(), this, this.getAuthenticationService());
}
} else if (message instanceof JoinGameRequestMessage) {
Game game = this.lobby.joinGame(this.getClient(),
((JoinGameRequestMessage) message).getGameId(),((JoinGameRequestMessage) message).getPasswort());
if (game != null) {
InGameState inGame = new InGameState(this.getOutQueue(), this
.getClient(), game.getQueue(), this,
this.getAuthenticationService());
authenticatedStateLogger.info("client "
+ this.getClient().getUserName() + " joined game "
+ game.getGameName() + " with gameid "
+ game.getGameId());
return inGame;
} else {
authenticatedStateLogger.error("failed to join game "
+ ((JoinGameRequestMessage) message).getGameId());