Display scene icon per room using UI !?

Options
ventsi
ventsi
Hi,

i'm creating a room like this:
RoomOptions roomOptions = new RoomOptions();
roomOptions.IsVisible = true;
roomOptions.IsOpen = true;
roomOptions.MaxPlayers = 8;

roomOptions.CustomRoomProperties = new ExitGames.Client.Photon.Hashtable();
roomOptions.CustomRoomProperties.Add("sceneID", currentMultiplayerLevelID);

PhotonNetwork.CreateRoom(roomNameField.text, roomOptions, PhotonNetwork.CurrentLobby);

but then in this overridden method that receives a list of all rooms, it's all correct except the properties hashtable is empty:
public override void OnRoomListUpdate(List<RoomInfo> roomList)
{
    foreach (var item in roomList)
    {
        // Prints 0. Properties hashtable is epmty
        Debug.LogError("Room properties count is : " +  item.CustomProperties.Count);
    }
}

Is using custom properties a good way to store data when creating the room, to be used when spawning UI room entries on other players computers, to get some data from it and use it, like showing icon based on the sceneID value stored in the properties, and if yes, why is properties hashtable empty!?

Comments

  • ventsi
    Options
    [SOLVED] I apparently was missing this part:
    roomOptions.CustomRoomPropertiesForLobby = new string[] { "sceneID" };
    

    We have to add a property to CustomRoomPropertiesForLobby array in order to be available in the lobby !