Storing Player's Turn

Options
Is there a "best" method for storing who's turn it is on the server? Do i used custom room properties? I've done the turn based tutorial but its pretty hard coded for 2 players. Any suggestions?

Comments

  • HI @3LXR,

    using the Custom Room Properties might be the best choice for this scenario. You can store the Client's ID (PhotonNetwork.player.ID to get the ID of the local player) for example. When you update the Custom Room Properties with the ID (or another unique identifier) of the next player, void OnPhotonCustomRoomPropertiesChanged(Hashtable propertiesThatChanged) will be called on all clients and each client can check, if it is their turn.