Can not fond room with the settings

Options
Hello everyone. I have trouble with my photon connection to a room that has some settings. My room creation is here
RoomOptions ro  = new RoomOptions();
        ExitGames.Client.Photon.Hashtable ht = new ExitGames.Client.Photon.Hashtable();
        ht.Add("Type", 1);
        ro.CustomRoomProperties = ht;
        PhotonNetwork.CreateRoom(null, ro, null, null);
And connection to the room
       PhotonNetwork.JoinRandomRoom(new ExitGames.Client.Photon.Hashtable() {{ "Type", 1 }}, 4);
But when i want to connect second player to the room he creates new room instead of join. However, count of player in room that was created first is less then maximum number of players in this room. If i use this
      PhotonNetwork.JoinRandomRoom();
There are no problems. Thank you.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @NikitaKogtikov,

    Thank you for choosing Photon!

    You need to expose the custom room property to the lobby as follows:
     RoomOptions ro  = new RoomOptions();
            ExitGames.Client.Photon.Hashtable ht = new ExitGames.Client.Photon.Hashtable();
            ht.Add("Type", 1);
            ro.CustomRoomProperties = ht;
            ro.CustomRoomPropertiesForLobby = new string[] {"Type"};
            PhotonNetwork.CreateRoom(null, ro, null, null);
  • Thank you very much @JohnTube. It works perfect now!!