How to share information (data) between players
Comments
-
Room custom properties is the best way to share information (data) between all players?
Because I am thinking to put the number of enemies killed in a custom propertie of the room but I dont know if this is the correct.0 -
Example:
/// protected void SetNumberEnemies()
/// This method is storing "Number of Enemies" in the rooms custom properties
/// Since PhotonNetwork.time is synchronized between all players, we can use this to
/// share time information between all players
///
{
ExitGames.Client.Photon.Hashtable newProperties = new ExitGames.Client.Photon.Hashtable();
newProperties.Add("NumberEnemies", 60);
PhotonNetwork.room.SetCustomProperties(newProperties);
}0 -
Yes custom room properties are the way to go.
You can make use of the new CAS feature to avoid "concurrency" issues.0 -
I read but there is no enought information about CAS and an example of code that I can use to avoid concurrency. And YES I am having concurrency. I tested here with other players.0