PlayerId generator issue in Spectator to Player
Posted: 21 May 2014, 05:24
Hi,
We are having an issue with the Player id when converting from Player to Spectator and Spectator to Player.
The issue is happening in the following scenario for a 2 player game.
Player1 joins the room and gets PlayerId = 1
Player2 joins the room and gets PlayerId = 2
Player2 leaves the room
Player1 is converted to a spectator from the server side using "gameRoom.switchPlayerToSpectator(Player1 );"
Then Player1 clicks get a message to Stay in the room or Leave. Once we click on "Stay in the room" we send a request from Flash to Server using "sfs.send(new SpectatorToPlayerRequest());" to make this user a player again.
Now Player1 has the PlayerId = 2 (note, Player1 never left the game room)
Player2 decides to join the game again and in this case PlayerId =0;
Why is playerId coming as 0 for Player2? I thought that PlayerIdGenerator would start from 1 for a game room.
Are we using the proper way of dealing with such a scenario?
Thanks.
We are having an issue with the Player id when converting from Player to Spectator and Spectator to Player.
The issue is happening in the following scenario for a 2 player game.
Player1 joins the room and gets PlayerId = 1
Player2 joins the room and gets PlayerId = 2
Player2 leaves the room
Player1 is converted to a spectator from the server side using "gameRoom.switchPlayerToSpectator(Player1 );"
Then Player1 clicks get a message to Stay in the room or Leave. Once we click on "Stay in the room" we send a request from Flash to Server using "sfs.send(new SpectatorToPlayerRequest());" to make this user a player again.
Now Player1 has the PlayerId = 2 (note, Player1 never left the game room)
Player2 decides to join the game again and in this case PlayerId =0;
Why is playerId coming as 0 for Player2? I thought that PlayerIdGenerator would start from 1 for a game room.
Are we using the proper way of dealing with such a scenario?
Thanks.