I am using Photon PUN with Unity. I have some static classes that track player data in my game. Here is an example of a method to update data...
public static void IsSeated(bool value)
{
Room room = PhotonNetwork.room;
Hashtable PlayerSeat1 = new Hashtable();
object[] seat1 = (object[])room.customProperties["seat1"];
seat1[0] = value;
PlayerSeat1.Add("seat1", seat1);
room.SetCustomProperties(PlayerSeat1);
}
The problem is when I update this hashtable all my other room data is over written with the changes. All of my hashtables have distinct keys. I would greatly appreciate any help.
I have resolved this issue...And it may be of interest to anyone using Photon Pun with Hashtables and Room data
When I initialized all of the hash table data during an Initialization method I was doing something like this...
Room room = PhotonNetwork.room;
Then when I would update any Room data it would overwrite all of my data even though I had distinct keys...
But when I initialize it like this...
Room room = PhotonNetwork.room;
it updates normally and does not overwrite any other Hashtables...