Problem with displaying all the available rooms

Options

Hello everyone.


I am trying to implement something that displays all the available rooms once the player presses the Refresh button. The problem that I am facing is that GetCustomRoomList() doesn't give any responses whatsoever.

I'm not doing any matchmaking stuff because I want the game to be fun.

Here's what I implemented.

private void Refresh()
    {
        PhotonNetwork.GetCustomRoomList(customLobby, "C0 = '1'");
    }


    public override void OnRoomListUpdate(List<RoomInfo> roomList)
    {
        Debug.Log(roomList.Count); // doesn't display anything
        Rooms = roomList; // Rooms = new List<RoomInfo>();
        RefreshVisual(); // just displays something.
    }


How I create the room:

RoomOptions options = new RoomOptions();
options.MaxPlayers = (byte)nrPlayers_HostGame;
options.CustomRoomProperties = new ExitGames.Client.Photon.Hashtable()
{
    { "C0", "1" }
};
options.CustomRoomPropertiesForLobby = new string[] { "C0" };

PhotonNetwork.CreateRoom(HG_NameGame.text, options, customLobby);

Am I doing something wrong here? Or does anyone have any better solutions to how to display all the rooms?

Thank you.

Answers

  • Tobias
    Options

    Please avoid double posting!

    I replied here and it cost me some time to find this again...

  • Steven123
    Options

    Sorry about that! I thought that this wasn't visible since nobody would reply to this question.