Question about filtering server results?

We're working on a shooter game based around your unity plug-in (and completely love it!). I had a quick question that I wasn't able to solve with the provided documentation. I saw the Room.properties hashtable, but upon trying to add any information to it I received an error saying it was read only I believe. My question is how would I go about exposing relevant information to the server browser, such as game type and maybe a list of player names?

Comments

  • You would need to expand pun so you can make use of the Room Properties and correctly send and receive them.
    PUN does not expose that itself.

    Either that or encode the information in the room name itself and correspondingly parse it
  • I had thought about splitting the string, was hoping there was a more elegant way already in there. Looks like I'll be extending PUN! Thank you Dreamora. Also, why are you so awesome? You get off on helping people? :P
  • I just happen to like to help others so they can achieve great things which I then might enjoy playing or using again :)
  • I'm not having much luck extending PUN's Room.properties to meet my needs. I'm sorry to ask this but could I get a simple addition to the Room script that someone has done? I can't find any examples anywhere and my attempts have been in vein.
  • Currently, the properties are not handled for you by PUN so you have to go one layer deeper.

    Take a look at:
    PhotonNetwork.NetworkingPeer.OpSetPropertiesOfGame()

    If you "broadcast" the change, it will send an event with the new properties. Set properties with a (short) string typed key.
    Careful: Currently the cloud includes all custom game/room properties in their lobby listing. This could amount to a lot of traffic, depending on the number of games and properties.
    We're currently working on a better solution with better support for properties.
  • Ahh, that explains my issues. Thank you very much for the insight!