mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* User handling - Fixed a recently added bug and added some debug messages.
This commit is contained in:
parent
83c3f92241
commit
6c8b818d89
2 changed files with 7 additions and 2 deletions
|
@ -327,18 +327,23 @@ public class User {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void kill(DisconnectReason reason) {
|
public void kill(DisconnectReason reason) {
|
||||||
|
logger.debug("start user kill");
|
||||||
for (GameSession gameSession: gameSessions.values()) {
|
for (GameSession gameSession: gameSessions.values()) {
|
||||||
gameSession.kill();
|
gameSession.kill();
|
||||||
}
|
}
|
||||||
|
logger.debug("user kill after game");
|
||||||
for (DraftSession draftSession: draftSessions.values()) {
|
for (DraftSession draftSession: draftSessions.values()) {
|
||||||
draftSession.setKilled();
|
draftSession.setKilled();
|
||||||
}
|
}
|
||||||
|
logger.debug("user kill after draft");
|
||||||
for (TournamentSession tournamentSession: tournamentSessions.values()) {
|
for (TournamentSession tournamentSession: tournamentSessions.values()) {
|
||||||
tournamentSession.setKilled();
|
tournamentSession.setKilled();
|
||||||
}
|
}
|
||||||
|
logger.debug("user kill after tournament");
|
||||||
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");
|
||||||
ChatManager.getInstance().removeUser(userId, reason);
|
ChatManager.getInstance().removeUser(userId, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class UserManager {
|
||||||
.append(" sessionId: ").append(user.getSessionId())
|
.append(" sessionId: ").append(user.getSessionId())
|
||||||
.append(" Reason: ").append(reason.toString()));
|
.append(" Reason: ").append(reason.toString()));
|
||||||
ChatManager.getInstance().removeUser(userId, reason);
|
ChatManager.getInstance().removeUser(userId, reason);
|
||||||
users.get(userId).kill(reason);
|
user.kill(reason);
|
||||||
users.remove(userId);
|
users.remove(userId);
|
||||||
} else {
|
} else {
|
||||||
logger.warn(new StringBuilder("Trying to remove userId: ").append(userId).append(" but user does not exist."));
|
logger.warn(new StringBuilder("Trying to remove userId: ").append(userId).append(" but user does not exist."));
|
||||||
|
@ -165,7 +165,7 @@ public class UserManager {
|
||||||
if (user.isExpired(expired.getTime())) {
|
if (user.isExpired(expired.getTime())) {
|
||||||
logger.info(new StringBuilder(user.getName()).append(": session expired userId: ").append(user.getId())
|
logger.info(new StringBuilder(user.getName()).append(": session expired userId: ").append(user.getId())
|
||||||
.append(" Host: ").append(user.getHost()));
|
.append(" Host: ").append(user.getHost()));
|
||||||
SessionManager.getInstance().getSession(user.getSessionId()).kill(DisconnectReason.SessionExpired);
|
removeUser(user.getId(), DisconnectReason.SessionExpired);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logger.debug("checkExpired - end");
|
logger.debug("checkExpired - end");
|
||||||
|
|
Loading…
Reference in a new issue