[Cloud, LoadBalancing] Room info without joining?

SBusch
edited January 2014 in Native
So, here is the problem:

I would really like to filter rooms to join, so i need to retrieve their properties without actually joining

From what I can see, the custom properties of a room only get transmitted after you actually join it. The rooms in client.getRoomList() only have empty hashtables if you try to access their custom properties

There is PropsListedInLobby, but I don't even know what the point of that is, as it's only accessible on MutableRooms and you need to be in a room to get its mutable counterpart

I could encode information in the room name, but that is super hack-ish and I don't even know if there is a size limit on the name and how much wiggle room that leaves me

PhotonPeer does seem to have the operation code 251, which is GETPROPERTIES, but LoadBalancing does not seem to implement it anywhere, so I would need to patch that in myself. While this seems to be the only viable solution right now, I would prefer to not to do it, because it will complicate upgrades in the future (apart from the fact that it is cumbersome and I might mess things up :D)

Any ideas/input on that?

Comments

  • Hi SBusch.

    PropsListedInLobby is for specifying, which properties you want to list in the lobby. Specifying this does only make sense, if you are actually inside the room and can modify it. All properties, that you have specified for a specific room in that way, will be included in the returnvalue of Room.getCustomProperties(), when retrieving that room from the roomlist inside the lobby.
  • The "Create Room" operation should have some overload with a string[] parameter PropsListedInLobby. Set a list of property keys (names) that you need to use in the lobby for matchmaking (example: "m" for "map" or "t" for "game type" or so). Out of all the room properties you set, on create or later on, these properties (key and values) will be available in the lobby. You don't even have to set those properties right away.
    The "Join Random Room" operation has a parameter "filter" of type Hashtable. With that, you can define which room properties you are looking for. Example: {"m", "dust"} will only find a room if map "dust" is set as property.
    If you don't find a fitting room you can re-try with less parameters or create a fitting room and let someone else join yours.