mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
Added some debug messages.
This commit is contained in:
parent
4e1901166b
commit
9dd35eced4
2 changed files with 9 additions and 5 deletions
|
@ -70,19 +70,21 @@ public class ChatSession {
|
|||
String userName = clients.get(userId);
|
||||
logger.debug(userName + " leaves chat: " + chatId);
|
||||
clients.remove(userId);
|
||||
String message;
|
||||
String message = null;
|
||||
switch (reason) {
|
||||
case Disconnected:
|
||||
message = " has left MAGE";
|
||||
message = " has left XMage";
|
||||
break;
|
||||
case LostConnection:
|
||||
message = " has lost connection";
|
||||
break;
|
||||
default:
|
||||
message = " has left chat";
|
||||
logger.debug(userName + " left chat with reason: " + reason.name() + " " + chatId);
|
||||
}
|
||||
if (message != null) {
|
||||
broadcast(null, new StringBuilder(userName).append(message).toString(), MessageColor.BLUE, true, MessageType.STATUS);
|
||||
logger.debug(userName + " left chat with reason: " + message + " " + chatId);
|
||||
}
|
||||
broadcast(null, new StringBuilder(userName).append(message).toString(), MessageColor.BLUE, true, MessageType.STATUS);
|
||||
logger.debug(userName + "left chat with reason " + message + " " + chatId);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -157,6 +157,7 @@ public class UserManager {
|
|||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
logger.debug("checkExpired - start");
|
||||
Calendar expired = Calendar.getInstance();
|
||||
expired.add(Calendar.MINUTE, -3);
|
||||
List<User> usersToCheck = new ArrayList<>();
|
||||
|
@ -169,6 +170,7 @@ public class UserManager {
|
|||
users.remove(user.getId());
|
||||
}
|
||||
}
|
||||
logger.debug("checkExpired - end");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue