Room count based on CustomRoomProperties

I'm creating and joining different rooms based on CustomRoomProperties.

PhotonNetwork.JoinRandomRoom(new Hashtable() { {"Property_1",value_1}, { "Property_2", value_2 } }, maxPlayers);

I need count of number of rooms based on these CustomRoomProperties.

One way that I found was using PhotonNetwork.GetRoomList() to get the RoomInfo array and then loop through all of them to look for matching CustomRoomProperties.

I want to ask if there is any better way of doing this as well. Because I have to do it a lot of time.



  • JohnTubeJohnTube mod
    edited December 2018
    Hi @Uzair,

    Thank you for choosing Photon!

    If you need stats you could change how you do the matchmaking by having separate lobbies instead of using lobby properties in a single lobby for everything.
    So you would have a lobby per lobby properties combination that you want to count the number of rooms having it and maybe get rid of those set of properties.
    Having multiple lobbies could help you get the number of rooms using Lobby Statistics.
  • Thank you for the response.

    So if I understand it correctly, I need to create lobbies based on the values I am using to create different rooms using CustomRoomProperties?

  • JohnTubeJohnTube mod
    edited December 2018
    Yes if the approach is suitable for your use case.
Sign In or Register to comment.