}
if (findGame(gameName) != null) {
logger.info("client tried to create game '" + gameName
+ "' but a game with the same name exists already");
sender.send(new CreateGameResponseMessage(ResponseType.failed));
return null;
}
Game game =
new Game(this.nextGameId++, gameName, mapId, maxPlayers, sender, Passwort, MaxEloPoints, MinEloPoints);
logger.info("new game: " + game);
this.games.add(game);
game.addObserver(this);
sender.send(new CreateGameResponseMessage(ResponseType.ok));
this.clients.remove(sender);
game.newClient(sender);
sendAll(playersMessage());