* Fixed ChatSession handling.

This commit is contained in:
LevelX2 2014-07-30 20:07:55 +02:00
parent 05426f7dec
commit f2fc548f08
2 changed files with 6 additions and 5 deletions

View file

@ -72,8 +72,6 @@ public class ChatManager {
public void leaveChat(UUID chatId, UUID userId) {
if (chatSessions.containsKey(chatId)) {
chatSessions.get(chatId).kill(userId, DisconnectReason.CleaningUp);
} else {
logger.debug("ChatManager:leaveChat - chatId does not exist - chatId: " + chatId +" userId: " + userId);
}
}

View file

@ -204,9 +204,12 @@ public class TableManager {
public boolean removeTable(UUID userId, UUID tableId) {
if (isTableOwner(tableId, userId) || UserManager.getInstance().isAdmin(userId)) {
leaveTable(userId, tableId);
ChatManager.getInstance().destroyChatSession(controllers.get(tableId).getChatId());
removeTable(tableId);
leaveTable(userId, tableId);
TableController tableController = controllers.get(tableId);
if (tableController != null) {
ChatManager.getInstance().destroyChatSession(tableController.getChatId());
removeTable(tableId);
}
return true;
}
return false;