Accessing other rooms' properties while not in lobby

Options

Hello!

While a game is already inside an active PUN2 room, and not the lobby for finding rooms, is it possible to access the custom properties of a separate room?

The game itself is player-versus-environment cooperative, but I wanted to know if it were possible for two different rooms to compete by being able to see and compare each other's progress. I had no luck searching the API for a way to access a Room or RoomInfo object directly without using a lobby listing callback and was wondering if its even possible.

Thank you for any pointers in advance!

Answers

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options

    Hi @coin,

    Thank you for choosing Photon!

    This is not possible and not recommended.

    Maybe the two separate competing rooms should be one instead and separate competing players using a different method logically ('interest groups', 'sequence channels' or more higher level abstract concept).

    If this is really necessary you need to add another separate realtime client (LoadBalancingClient) that joins a lobby or even the other room to gather this info.

    Alternatively you have special client(s) that run in your backend (web maybe) and collect all useful info (join lobbies or rooms or save data and stats). Then you can query the data using HTTP requests.

  • coin
    Options

    I appreciate the response and will look into the options you listed, thank you!