Do all Expected Properties have to match with the Custom Room Properties?

Options
Hello everyone,
I've made a Custom Matchmaking system with GameModes actually. But I also have some other Custom Room Properties like Minimum Player Amount to start a match, the Scene Name of the Map and another integer.
These are set by the Player, who creates a room, because all these Custom Properties are being set in OnJoinRandomFailed(). And there I create a new room with these properties.
But if I search a room, the expected Properties just include the Game Mode and not all the other parameters because they don't matter for the decision if the Player should join the room or not.
And now I can't get 2 Players with the same selected Game Mode in the same room - the second player creates a new room even if there is already a room with the same Game Mode string in the Custom Properties.
But in the expected Room Properties, I have just the Game Mode as an expected Room Property. Do I have to pass all the Parameters in the Expected Properties which are included in the Custom Room Properties? If yes, then I can't really do it, because the Map name for example doesn't matter, it can be any Map. And I also set the MaxPlayer Parameter in PhotonNetwork.JoinRandomRoom(). And the game modes are the same, I checked it.

And these are my two methods which are responsible for this whole thing (the variables gameMode and the other are set in another script, but I use the same variables in both methods): https://pastebin.com/Wt4Z3GF2

Thank you very much already in advance, I hope someone can help me!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @Duck,

    Thank you for choosing Photon!

    As you can read in the "Matchmaking Checklist":
    If you are doing random matchmaking using room properties as a filter make sure to set the keys of those properties to be visible from the lobby when creating the room.

    add
    roomOptions.CustomRoomPropertiesFoLobby = new[] { "GameMode" };
    
  • Duck
    Duck
    edited April 2020
    Options
    Good evening @JohnTube

    It's a pleasure to use Photon. You really made Multiplayer easy ;)

    So you just suggest to use CustomRoomPropertiesForLobby instead? CustomRoomPropertiesForLobby instead of CustomRoomProperties when I'm creating a new Room, am I right?
    If yes, than I'll have to use a string Array, but I also want to pass integers as properties. And that could be a problem...
    Or do you suggest to keep that, what I have AND add just the GameMode as a Custom Property for the lobby?

    Thank you very much for your help and have a nice day!
  • Duck
    Options
    Hello @JohnTube

    Thank you very much for your help. That helped me a lot. Now it works also with Custom Properties.

    Have a nice day!