mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Fixed ChatSession handling.
This commit is contained in:
parent
05426f7dec
commit
f2fc548f08
2 changed files with 6 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue