When a user joins our lobby room, the server will join the user also in another room (a game room). He'll be online in both rooms. I transfer the user to the game room in the user joined event I get from the lobby room with the following code:
Code: Select all
SmartFoxServer.getInstance().getAPIManager().getSFSApi().joinRoom(user, _gameLobbyRoom, null, false, null, true, true);
This works on my local machine, but when I launch the server extension on a slower machine, I get the following exception:
Code: Select all
Exception: com.smartfoxserver.v2.exceptions.SFSRuntimeException
Message: Join request discarded. User is already in a join transaction: ( User Name: jan, Id: 0, Priv: 0, Sess: 184.71.175.150:32259 )
Description: Error during event handling: com.smartfoxserver.v2.exceptions.SFSRuntimeException: Join request discarded. User is already in a join transaction: ( User Name: jan, Id: 0, Priv: 0, Sess: 184.71.175.150:32259 ) , Listener: { Ext: ourextension, Type: JAVA, Lev: ROOM, { Zone: zoneName }, [ Room: Lobby, Id: 0, Group: default, isGame: false ] }
+--- --- ---+
Stack Trace:
+--- --- ---+
com.smartfoxserver.v2.api.SFSApi.joinRoom(SFSApi.java:773)
sfs2x.extension.ourpackage.SFSUserJoinedLobbyEventHandler.handleServerEvent(SFSUserJoinedLobbyEventHandler.java:35)
com.smartfoxserver.v2.extensions.SFSExtension.handleServerEvent(SFSExtension.java:242)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.dispatchEvent(SFSExtensionManager.java:760)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.dispatchRoomLevelEvent(SFSExtensionManager.java:709)
com.smartfoxserver.v2.entities.managers.SFSExtensionManager.handleServerEvent(SFSExtensionManager.java:889)
com.smartfoxserver.v2.core.SFSEventManager$SFSEventRunner.run(SFSEventManager.java:64)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
java.lang.Thread.run(Unknown Source)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Isn't it allowed to already let the user join another room in the SFSEventType.USER_JOIN_ROOM event handler?
Thanks