Get Room list while in a room?

Is it possible to query for currently established rooms, while one is already in a room (and not the lobby)? I have a virtual chat area where people can browser for new rooms, while still playing, chatting and being in their current room.

I've seen an older thread on this here, but it's from several years ago, so I was wondering if it's easier now. Thanks!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @Philipp,

    The same question was asked on newer threads as well.
    Nothing has changed: you can get rooms list only while joined to a lobby of supported type and not joined to a room.
  • Thank you. So this answer is the authoritative correct approach then?

    You have 2 options for this:
    a) If you are using Photon Server and not Photon Cloud, then you could modify the game server code to request that list from the master server
    b) You could create 2 peer instances in your client. The main instance would actually join the game rooms, while the second instance would stay in the lobby on the master server and just be responsible for receiving the game list updates. The downside of this approach is, that each connected peer counts as one CCU.
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited July 2019
    a) is the "authoritative" approach.

    There is also:

    c) have a backend that lists rooms based on Photon Realtime webhooks or custom client to the backend (via HTTP). This way you can have the list outside of Photon.

    I cannot qualify any of the 3 approaches as "correct".
    Use whatever suits you best.
    Option a) is the hardest.
  • Thank you!

    As an adjustment to b), would it also make sense to only briefly launch the 2nd peer instance when the user opens the "Areas" type dialog (and to then disconnect that client again)? For starters, this wouldn't count against a CCU limit, plus it might create less network overhead. (For the sake of argument, let's say users look at the Areas dialog once every 5 minutes on average, and frequent looks on it are cached.)
  • JohnTube
    JohnTube ✭✭✭✭✭
    Yes you can optimize this and make the client connect only when needed.
  • Thanks again! Great support!