From 4857f89b767e75b13061dfae220ebfd348f39cc8 Mon Sep 17 00:00:00 2001 From: CrazyIvan007 Date: Thu, 30 Jun 2016 12:15:44 +0200 Subject: [PATCH] Bug when using leaveRoom When using leaveRoom, the complete clientRooms Instance get removed, which causes the SocketIOClient getAllRooms Method to returns a empty list, even when your client is still in some rooms. This doesn't harm SocketIOServer getRoomOperations Method (which still returns all clients from the given room), but harms for example the onDisconnectListener, when you override the onDisconnect Method, which than returns a empty list for the joinedRooms. --- .../java/com/corundumstudio/socketio/namespace/Namespace.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java b/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java index 5b6d72c..2555869 100644 --- a/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java +++ b/src/main/java/com/corundumstudio/socketio/namespace/Namespace.java @@ -301,7 +301,7 @@ public class Namespace implements SocketIONamespace { public void leave(String room, UUID sessionId) { leave(roomClients, room, sessionId); - clientRooms.remove(sessionId); + leave(clientRooms, sessionId, room); } public Set getRooms(SocketIOClient client) {