Room Custom Properties not Syncing
Options
Just after creating a room I use
[code2=csharp]ExitGames.Client.Photon.Hashtable roomProperties = new ExitGames.Client.Photon.Hashtable();
roomProperties.Add("MyKey", 2);
Debug.Log("roomroperties: " + roomProperties);
PhotonNetwork.room.SetCustomProperties(roomProperties);[/code2]
When I check it from another player who is not in the room, the custom property that I added is not there. After waiting more than a minute it is still not there.
[code2=csharp]RoomInfo[] rooms = PhotonNetwork.GetRoomList();
foreach (RoomInfo room in rooms)
{
if (room.name == roomName)
{
properties = room.customProperties;
Debug.Log("Room \"" + roomName + "\" custom properties: " + properties);
}
break;
}[/code2]
Using the debug statements I can see that the custom properties are being set correctly, but when being read, there are no custom properties. What can I do to be able to see the custom property from outside the room?
[code2=csharp]ExitGames.Client.Photon.Hashtable roomProperties = new ExitGames.Client.Photon.Hashtable();
roomProperties.Add("MyKey", 2);
Debug.Log("roomroperties: " + roomProperties);
PhotonNetwork.room.SetCustomProperties(roomProperties);[/code2]
When I check it from another player who is not in the room, the custom property that I added is not there. After waiting more than a minute it is still not there.
[code2=csharp]RoomInfo[] rooms = PhotonNetwork.GetRoomList();
foreach (RoomInfo room in rooms)
{
if (room.name == roomName)
{
properties = room.customProperties;
Debug.Log("Room \"" + roomName + "\" custom properties: " + properties);
}
break;
}[/code2]
Using the debug statements I can see that the custom properties are being set correctly, but when being read, there are no custom properties. What can I do to be able to see the custom property from outside the room?
0
Comments
-
When calling OpCreateRoom, set RoomOptions.customRoomPropertiesForLobby parameter to the list of names of options which you want to see for non-joined rooms. Then your code should work.
Room list updated only if client is in lobby. OnReceivedRoomListUpdate will be fired each time 'listed in lobby' property changed.0