Expected Custom Room properties doesn't appear to be working

Options
I am using the following code to connect or create a random room. For Some reason the JoinRandom never finds the created room if I pass in the expected custom room properties. if i don't pass any expected properties then it does find the room. What am i doing wrong?
PhotonNetwork.CreateRoom(string.Empty, new RoomOptions
        {
            CustomRoomProperties = new Hashtable
            {
                { "map", "Test" }
            },
            MaxPlayers = 2,
            PublishUserId = true
        }, null);
And
PhotonNetwork.JoinRandomRoom(new Hashtable
        {
            { "map", "Test" }
        }, 2);

Best Answer

Answers

  • PhotonUser
    edited June 2021
    Options
    @JohnTube
    using PhotonHashTable = ExitGames.Client.Photon.Hashtable;
    
    private void FindMatch()
        {
            PhotonNetwork.JoinRandomRoom(new PhotonHashTable() { { "map", "Test" } }, 10);
        }
    
        public override void OnJoinRandomFailed(short returnCode, string message)
        {
            Debug.Log("OnJoinRandomFailed() -> Creating a new room.");
    
            PhotonNetwork.CreateRoom(string.Empty, new RoomOptions
            {
                CustomRoomPropertiesForLobby = new string[]{ "map" },
                CustomRoomProperties = new PhotonHashTable
                {
                    { "map", "Test" }
                },
                MaxPlayers = 2,
                PublishUserId = true
            }, null);
        }
    

    this always creates a new room...

    EDIT: oh sorry.

    expectedMaxPlayers set to 10 where I am creating the room with 2.

    always remember to check for typos.