Simultaneous Game Room Join Bug
Posted: 11 Jul 2010, 03:21
Lapo,
My SmartFox game community has been experiencing problems when multiple users try to join a game room at the same time. I have investigated the problem and determined it to be a possible bug with the Smart Fox Server.
The issue:
Multiple users get assigned the same game room player id OR a user gets assigned a player id of -1 when they should be receiving a valid player index.
How to Recreate the issue:
1) Setup two testing machines. Login into the game client on one machine and create a game room.
2) Open two additional instances of the game client (one on each machine).
3) Have both users join the game room at the same time (several attempts may be needed to get the effect).
4) Trace statements will indicate a player id of -1 assigned to one of the users and/or both players will get tracked as having the same player id.
As a result of this bug, one or more of the following problems can happen in my game lobby:
1) Two users might get assigned to the same player slot (only one will actually get stored in the room variable, but on the other player's screen, it will appear that they are in that slot)
2) A user may simply fail to get assigned a player slot (since there player id was set to -1). This will cause an internal bug with my client, requiring the user to leave the room and rejoin to be assigned a valid player id.
This bug is becoming a particularly problematic issue since I released 8-player game support. After finishing a game, players will frequently start a new game and then all pile into the room at the same time. I would expect the server to delay sending a user join response until it can properly assign each user a valid player id.
I appreciate your support in advance, and, as always, I am happy to provide further information and support in whatever way I can to expedite a fix.
My SmartFox game community has been experiencing problems when multiple users try to join a game room at the same time. I have investigated the problem and determined it to be a possible bug with the Smart Fox Server.
The issue:
Multiple users get assigned the same game room player id OR a user gets assigned a player id of -1 when they should be receiving a valid player index.
How to Recreate the issue:
1) Setup two testing machines. Login into the game client on one machine and create a game room.
2) Open two additional instances of the game client (one on each machine).
3) Have both users join the game room at the same time (several attempts may be needed to get the effect).
4) Trace statements will indicate a player id of -1 assigned to one of the users and/or both players will get tracked as having the same player id.
As a result of this bug, one or more of the following problems can happen in my game lobby:
1) Two users might get assigned to the same player slot (only one will actually get stored in the room variable, but on the other player's screen, it will appear that they are in that slot)
2) A user may simply fail to get assigned a player slot (since there player id was set to -1). This will cause an internal bug with my client, requiring the user to leave the room and rejoin to be assigned a valid player id.
This bug is becoming a particularly problematic issue since I released 8-player game support. After finishing a game, players will frequently start a new game and then all pile into the room at the same time. I would expect the server to delay sending a user join response until it can properly assign each user a valid player id.
I appreciate your support in advance, and, as always, I am happy to provide further information and support in whatever way I can to expedite a fix.