* Some changes to logging.

This commit is contained in:
LevelX2 2014-06-25 17:17:17 +02:00
parent abc441a4ba
commit d337e2cc13
3 changed files with 16 additions and 8 deletions

View file

@ -327,23 +327,23 @@ public class User {
}
public void kill(DisconnectReason reason) {
logger.debug("start user kill");
logger.debug("user.kill before game session " + gameSessions.size() );
for (GameSession gameSession: gameSessions.values()) {
gameSession.kill();
}
logger.debug("user kill after game");
logger.debug("user.kill before draft session " + draftSessions.size());
for (DraftSession draftSession: draftSessions.values()) {
draftSession.setKilled();
}
logger.debug("user kill after draft");
logger.debug("user.kill before tournament session " + tournamentSessions.size());
for (TournamentSession tournamentSession: tournamentSessions.values()) {
tournamentSession.setKilled();
}
logger.debug("user kill after tournament");
logger.debug("user.kill before tables " + tables.size());
for (Entry<UUID, Table> entry: tables.entrySet()) {
TableManager.getInstance().leaveTable(userId, entry.getValue().getId());
}
logger.debug("user kill after table");
logger.debug("user.kill before chat remove user");
ChatManager.getInstance().removeUser(userId, reason);
}

View file

@ -149,7 +149,15 @@ public class TournamentController {
public synchronized void join(UUID userId) {
UUID playerId = userPlayerMap.get(userId);
if (playerId == null) {
logger.error("join: got no playerId for userId: " + userId + " for tournament " + tournament.getId());
return;
}
TournamentSession tournamentSession = new TournamentSession(tournament, userId, tableId, playerId);
if (tournamentSessions == null) {
logger.error("join: got no playerId for userId: " + userId + " for tournament " + tournament.getId());
return;
}
tournamentSessions.put(playerId, tournamentSession);
UserManager.getInstance().getUser(userId).addTournament(playerId, tournamentSession);
TournamentPlayer player = tournament.getPlayer(playerId);

View file

@ -946,13 +946,13 @@ public abstract class GameImpl implements Game, Serializable {
if (state != null) {
Player player = state.getPlayer(playerId);
if (player != null) {
logger.debug(player.getName() + " quits the game");
logger.debug("gameImpl.quit" + player.getName() + " quits the game");
player.quit(this);
}else {
logger.error(new StringBuilder("quit - player not found - playerId: ").append(playerId));
logger.error(new StringBuilder("gameImpl.quit - player not found - playerId: ").append(playerId));
}
} else {
logger.error(new StringBuilder("quit - state not found - playerId: ").append(playerId));
logger.error(new StringBuilder("gameImpl.quit - state not found - playerId: ").append(playerId));
}
}