Using PUN 2 - what's the simplest way to get a room count based on type of room?

Options

Hello, 

We're using PUN 2 and we have 2 different game modes in our multiplayer game - one competitive and one cooperative (that we set using CustomRoomProperties). We're hoping to get just a bit more information than total CCU or total rooms.

Is there a easy way to see how many rooms of each type are generated by players?

As far as I can tell there are 3 ways? Use webhooks, add an analytics program, or put everything in a custom lobby and use OnRoomListUpdate (which doesn't work the default lobby)?

Am I missing anything?

Thanks!

Best Answer

  • Tobias
    Tobias admin
    Answer ✓
    Options

    You could split the modes into different lobbies and at runtime use the Lobby Stats to get info on how many rooms each has. Clients don't have to join the lobbies to get those numbers! Also, creating a room has the option to attach it to one or the other lobby, without ever joining one.

    See: https://doc.photonengine.com/pun/current/lobby-and-matchmaking/appandlobbystats


    Aside from this, WebHooks can also be used to report those numbers from our Photon Servers to your own services. This is not related to in-game info, unless your clients fetch these values from your service.


    If you need the info in the clients, I think the Lobby Stats are what you need. If needs be, we can define server-side, which lobbies are allowed to be used by clients. At the moment, you'd have to mail us for that: developer@photonengine.com

Answers

  • Tobias
    Tobias admin
    Answer ✓
    Options

    You could split the modes into different lobbies and at runtime use the Lobby Stats to get info on how many rooms each has. Clients don't have to join the lobbies to get those numbers! Also, creating a room has the option to attach it to one or the other lobby, without ever joining one.

    See: https://doc.photonengine.com/pun/current/lobby-and-matchmaking/appandlobbystats


    Aside from this, WebHooks can also be used to report those numbers from our Photon Servers to your own services. This is not related to in-game info, unless your clients fetch these values from your service.


    If you need the info in the clients, I think the Lobby Stats are what you need. If needs be, we can define server-side, which lobbies are allowed to be used by clients. At the moment, you'd have to mail us for that: developer@photonengine.com

  • Thanks so much! That does look like the easiest way to do this - and not having to join the lobbies is great!