Empty CustomProperties on different join

When i create a room with build 1, and try viewing the List of created room with build 2 using

Debug.Log(PhotonNetwork.room);
foreach (RoomInfo room in PhotonNetwork.GetRoomList())
{
Debug.Log(room.CustomProperties);
}

I get a result like:

Null
UnityEngine.Debug:Log(Object)

''
UnityEngine.Debug:Log(Object)

A question liked this was also asked Here

but no answer yet.

BTW this are the methods i used to set the room properties but non worked.
public void CreateRoom()
{
PhotonNetwork.CreateRoom(roomName.text, new RoomOptions() {
IsVisible = true,
IsOpen = true,
MaxPlayers = 2,
CleanupCacheOnLeave = true,
}, TypedLobby.Default);
}

void OnCreatedRoom()
{
ExitGames.Client.Photon.Hashtable roomOption = new ExitGames.Client.Photon.Hashtable();
roomOption.Add(Constants.MODE, mode.name);
roomOption.Add(Constants.MAP_NAME, mode.selectedMap.name);

PhotonNetwork.room.SetCustomProperties(roomOption);
LocalSceneManager.instance.ActivateScene("Room");
}
And
ExitGames.Client.Photon.Hashtable roomOption = new ExitGames.Client.Photon.Hashtable();
roomOption.Add(Constants.MODE, mode.name);
roomOption.Add(Constants.MAP_NAME, mode.selectedMap.name);

PhotonNetwork.CreateRoom(roomName.text, new RoomOptions() {
IsVisible = true,
IsOpen = true,
CustomRoomProperties = roomOption,
MaxPlayers = (byte)roomSizeLabel[roomSize.value],
CleanupCacheOnLeave = true,
}, TypedLobby.Default);

Comments

  • Hi @chrys,

    when creating the room, you have to tell the server, which properties are available to the lobby in order to show them to clients that are not in the room but joined the lobby. You can do this by using the Room Options. Having those you are looking for the CustomRoomPropertiesForLobby string array. You have to add the property you want to make available to the lobby by its name to that array. For example: CustomRoomPropertiesForLobby = new string[] { Constants.MODE };