App and Lobby Stats

Photon servers can broadcast application and lobby statistics to clients. You can make use of this data to implement a complex custom matchmaking system. You can also brag about these statistics in your game to show how popular it is. :]

Application Statistics

When connected to a Photon master server, a Photon client receives applications statistics. Regardless of whether the client is joined to a lobby or not, it will receive AppStats events. Application statistics are per region.

The applications statistics are:

  • Number of live rooms: check loadBalancingClient.RoomsCount.
  • Number of players not joined to rooms: check loadBalancingClient.PlayersOnMasterCount.
  • Number of players inside rooms: check loadBalancingClient.PlayersInRoomsCount.

AppStats event is sent every five seconds.

Lobby Statistics

Lobby statistics can be useful if a game uses multiple lobbies and you want to show activity of each to players. Lobby statistics are per region.

Per typed lobby (name + type) you can get information about:

  • Number of live rooms
  • Number of players not joined to a room

Automatically Get Lobby Statistics

Lobby statistics events are sent as soon as the client is authenticated to a master server then they are sent every minute. Lobby statistics events are disabled by default.

Set loadBalancingClient.EnableLobbyStatistics = true; before connecting to get lobby statistics from the server.

Check loadBalancing.LobbyStatistics to get the statistics.

 To Document Top