How to share information (data) between players

Massive
Massive
edited May 2016 in DotNet
How can I share information between all players, like numbers of enemies killed ?

PS: I tried to share number of enemies and when it is killed 90 new level is lodaded but more than one player is calling load level



Comments

  • Massive
    Massive
    edited May 2016
    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.
  • Example:

    ///
    /// 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
    ///
    protected void SetNumberEnemies()
    {
    ExitGames.Client.Photon.Hashtable newProperties = new ExitGames.Client.Photon.Hashtable();
    newProperties.Add("NumberEnemies", 60);

    PhotonNetwork.room.SetCustomProperties(newProperties);
    }
  • Yes custom room properties are the way to go.
    You can make use of the new CAS feature to avoid "concurrency" issues.
  • 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.