Problem with joining and creating rooms
Posted: 28 Oct 2015, 19:33
Hi,
We are starting up an online turn based game project by using smart fox as our back end, but there are some strange behaviors in different parts of the platform which makes it difficult to develop at this phase, now i decided to discuss some of these problem here, starting with this scenario:
UserA joins MyZone, at first he is not subscribed to any group because i have configured no default group in AdminTool to subscribe after login.
Then he subscribes to MyGroup, (here MyGroup is empty since no room is created yet)
Then he sends a custom message called "createRoom" via ExtensionRequest, At server side i will capture this message and create a room named MyRoom with my preferred room settings. Of course i do this with SFSApi so client will be notified about MyRoom.
MyRoom has the following settings :
isDynamic = true
isGame = true
groupId = "MyGroup"
autoRemoveMode = SFSRoomRemoveMode.WHEN_EMPTY
Now UserB joins MyZone, subscribes to MyGroup and then joins MyRoom.
at this point UserA leaves MyRoom. MyRoom should remain in room list because of autoRemoveMode settings and the fact that UserB is still in MyRoom.
Everything works fine with noFault, except when i query room list in client side with RoomManager.GetRoomList(), UserA gets an empty list. but he is still subscribed to MyGroup and MyRoom belongs to MyGroup and it's not destroyed yet. So UserA should see MyRoom in its RoomList but he don't.
I tried to figure this out, and after digging into client source code api for some hours, i found that MyRoom at client side has a flag called isManaged (which is used by api only) set to false, and that forces room manager to remove room from it's list when user leaves the room. isManaged flag is set false because room manager doesn't have MyGroup in it's "groups" variable ("groups" is a private list inside room manager) and this happens because at subscription time MyGroup is empty.
so what's the problem. Is this a bug or I'm doing things wrong way.
thanks for your patience
We are starting up an online turn based game project by using smart fox as our back end, but there are some strange behaviors in different parts of the platform which makes it difficult to develop at this phase, now i decided to discuss some of these problem here, starting with this scenario:
UserA joins MyZone, at first he is not subscribed to any group because i have configured no default group in AdminTool to subscribe after login.
Then he subscribes to MyGroup, (here MyGroup is empty since no room is created yet)
Then he sends a custom message called "createRoom" via ExtensionRequest, At server side i will capture this message and create a room named MyRoom with my preferred room settings. Of course i do this with SFSApi so client will be notified about MyRoom.
MyRoom has the following settings :
isDynamic = true
isGame = true
groupId = "MyGroup"
autoRemoveMode = SFSRoomRemoveMode.WHEN_EMPTY
Now UserB joins MyZone, subscribes to MyGroup and then joins MyRoom.
at this point UserA leaves MyRoom. MyRoom should remain in room list because of autoRemoveMode settings and the fact that UserB is still in MyRoom.
Everything works fine with noFault, except when i query room list in client side with RoomManager.GetRoomList(), UserA gets an empty list. but he is still subscribed to MyGroup and MyRoom belongs to MyGroup and it's not destroyed yet. So UserA should see MyRoom in its RoomList but he don't.
I tried to figure this out, and after digging into client source code api for some hours, i found that MyRoom at client side has a flag called isManaged (which is used by api only) set to false, and that forces room manager to remove room from it's list when user leaves the room. isManaged flag is set false because room manager doesn't have MyGroup in it's "groups" variable ("groups" is a private list inside room manager) and this happens because at subscription time MyGroup is empty.
so what's the problem. Is this a bug or I'm doing things wrong way.
thanks for your patience