forked from External/mage
* Some changes to logging.
This commit is contained in:
parent
abc441a4ba
commit
d337e2cc13
3 changed files with 16 additions and 8 deletions
|
|
@ -327,23 +327,23 @@ public class User {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void kill(DisconnectReason reason) {
|
public void kill(DisconnectReason reason) {
|
||||||
logger.debug("start user kill");
|
logger.debug("user.kill before game session " + gameSessions.size() );
|
||||||
for (GameSession gameSession: gameSessions.values()) {
|
for (GameSession gameSession: gameSessions.values()) {
|
||||||
gameSession.kill();
|
gameSession.kill();
|
||||||
}
|
}
|
||||||
logger.debug("user kill after game");
|
logger.debug("user.kill before draft session " + draftSessions.size());
|
||||||
for (DraftSession draftSession: draftSessions.values()) {
|
for (DraftSession draftSession: draftSessions.values()) {
|
||||||
draftSession.setKilled();
|
draftSession.setKilled();
|
||||||
}
|
}
|
||||||
logger.debug("user kill after draft");
|
logger.debug("user.kill before tournament session " + tournamentSessions.size());
|
||||||
for (TournamentSession tournamentSession: tournamentSessions.values()) {
|
for (TournamentSession tournamentSession: tournamentSessions.values()) {
|
||||||
tournamentSession.setKilled();
|
tournamentSession.setKilled();
|
||||||
}
|
}
|
||||||
logger.debug("user kill after tournament");
|
logger.debug("user.kill before tables " + tables.size());
|
||||||
for (Entry<UUID, Table> entry: tables.entrySet()) {
|
for (Entry<UUID, Table> entry: tables.entrySet()) {
|
||||||
TableManager.getInstance().leaveTable(userId, entry.getValue().getId());
|
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);
|
ChatManager.getInstance().removeUser(userId, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,15 @@ public class TournamentController {
|
||||||
|
|
||||||
public synchronized void join(UUID userId) {
|
public synchronized void join(UUID userId) {
|
||||||
UUID playerId = userPlayerMap.get(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);
|
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);
|
tournamentSessions.put(playerId, tournamentSession);
|
||||||
UserManager.getInstance().getUser(userId).addTournament(playerId, tournamentSession);
|
UserManager.getInstance().getUser(userId).addTournament(playerId, tournamentSession);
|
||||||
TournamentPlayer player = tournament.getPlayer(playerId);
|
TournamentPlayer player = tournament.getPlayer(playerId);
|
||||||
|
|
|
||||||
|
|
@ -946,13 +946,13 @@ public abstract class GameImpl implements Game, Serializable {
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
Player player = state.getPlayer(playerId);
|
Player player = state.getPlayer(playerId);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
logger.debug(player.getName() + " quits the game");
|
logger.debug("gameImpl.quit" + player.getName() + " quits the game");
|
||||||
player.quit(this);
|
player.quit(this);
|
||||||
}else {
|
}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 {
|
} else {
|
||||||
logger.error(new StringBuilder("quit - state not found - playerId: ").append(playerId));
|
logger.error(new StringBuilder("gameImpl.quit - state not found - playerId: ").append(playerId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue