Added some debug messages.

This commit is contained in:
LevelX2 2014-06-02 08:31:06 +02:00
parent 4e1901166b
commit 9dd35eced4
2 changed files with 9 additions and 5 deletions

View file

@ -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);
}
}

View file

@ -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");
}
}
);