How to implement this feature?

Options
FullTun
edited October 2012 in Photon Server
Dear All,

I am developing a game using Photon (V3) as the game server. For Game Room functionality I am using the Lite Lobby application. However, I have made certain changes to the Lite application on which Lite Lobby application is built. So far they serve my current requirements. I am faced with a new requirements now: 1) If he or she is taken a pause, that should be allowed; 2) If the Internet connection is lost for player, the player shall have the opportunity to find his room and log in again.

It would be helpful for your understanding if I provide a background into how multiplayer feature works on client/server side. I require a player to log in with a username just as anyone who intends to join a chat. The player enters the lobby after login phase completes. Then, they either type in a new room name or join an existing game room. After joining the game room, the game starts.

On the server side, I have implemented a turn allocation system (the whole game is currently turn based). The turns are allocated on basis of Player IDs which the Lite/Lite Lobby application maintain. The player who arrives first in the room is given the first turn (as he/she is assigned a Player ID which is lower in numerical value than to any other player who joins the room later). After a certain game operation, turn is passed to the player with a Player ID that is smallest among all the Player IDs greater than that of the player with previous turn. This continues till the player with highest Player ID has played his/her turn. Then the turn is passed to the player with lowest Player ID. If network problem arises, the player is removed from the room.

I have also implemented a Lock functionality on the server side. The game room is locked once all the players have joined. This functionality is necessary to prevent prospective players to join the game once it's started.

For first requirement namely, Pause, I would pass the turn to the next player once I am allocated the turn. But for the second feature what should I do?

If Internet disconnection occurs on the client side, the player would be kicked out of the game room. And he/she won't be able to enter the game room as it would be locked. I also don't want the player to be assigned a new Player ID even if he/she joins the room.