Cross-Room player list

KurtSerge
edited September 2012 in Native
I'm currently using the Load Balancing server app. I need to be in a room, and simultaneously know the player list of another completely different room. The only way that I could think to do this is to have two ExitGames::LoadBalancing::Client peers connecting to the server, then join both rooms simultaneously. Is there any downside to this approach, or is there any better way to achieve this?

Thanks,
Kurt

Comments

  • The downside is, that you would also appear in that roomlist yourself, so if all clients do this, you have a lot of players in the list, that are just in the room, to get the roomlist. You would also have to account for them in the maxPlayers property, which with this apporach gets pretty much unusable. Probably closing rooms for games, that have started, also makes no sense anymore this way, as these player list observers then also could not join anymore.

    I would instead do it in the following way:
    Additionally to the actual game room let your clients join a second room with a second peer and let this room solely be there for providing playerlists of other rooms. Everytime the list of players in the regular game room, in which your client is in, changes, your client would update the room properties of this second room with the updated playerlist. These room properties would hold one string key for every open game room consisting of the roomname and a string array as value, holding the list of players in it. The players inside the same game room would all update the info for this room, which should not be a problem, as they would all update it with the same info. You could set broadcast to true when upating the properties, so that all clients in this spceial room get an update event for it, but with evey client of your app inside this room this would bomb your clients with an awful lot of unneeded information, so I would not do this but instead let your clients just request the playerlist value for a given roomname key, whenever they need up to date info about the players in that specific game room. The downside of this approach is, that with all those players in one room the would get a lot of join and leave events there (for every other client, that is joining or leaving this special room), but as there is not much sense in joining and leaving it all the time, but just, when you actually join a game room or even just when connecting/disconnecting to/from Photon (meaning a connet through the API, not counting for internal server switches under the hood when joining/leaving game rooms), this should be OK as long as you do not have many thousands of concurrently online players. If you are connecting to a self hosted Photon server and not to the cloud, you could modify the server code, to not send join and leave events to the clients for this one special room to reduce traffic, if you are having a real lot of players in there.
  • Thank you Kaiserludi, this is very helpful advice and answers my concerns.