Room capacity
Options
cscan
✭
When user join into the room, if the capacity (CCU?) is reached, I want to show a warning dialog to user. How can I know this error event?
0
Comments
-
You have to implement OnConnectionFail (as described in PhotonNetworkingMessage.OnConnectionFail) and check the DisconnectCause. It will be MaxCcuReached in that case.
Makes sense?0 -
Exactly what I want. Thanks.
BTW, is there any way to retrieve the number of concurrent users? I want to show how many ppl online, is it possible?0 -
Some stats available while client connected to MasterServer (joined to lobby):
PhotonNetwork.countOfPlayersOnMaster - The count of players currently looking for a room.
PhotonNetwork.countOfPlayersInRooms - The count of players currently inside rooms.
PhotonNetwork.countOfPlayers - The count of players currently using this application.
PhotonNetwork.countOfRooms - The count of rooms currently in use.
Also you can iterate PhotonNetwork.GetRoomList() and get current player count for each room: room.playerCount.
When joined to room, actual player count is available only for current room: PhotonNetwork.room.playerCount0 -
Thanks. That's exactly what I want.0
-
vadim wrote:..
PhotonNetwork.countOfPlayers - The count of players currently using this application.
...
can i list them as PhotonPlayer?
i need name of them0 -
aanimation wrote:vadim wrote:..
PhotonNetwork.countOfPlayers - The count of players currently using this application.
...
can i list them as PhotonPlayer?
i need name of them
Lists of players are not available in lobby.
The only possible thing is retrieving players statuses by known names via PhotonNetwork.FindFriends0 -
My problem is nearly resolve, but I hit another problem as I also need to know how many capacity are rest for available comer. As the capacity will be upgraded in the future, my boss don't want me to hard-coded in the program. Is there any way to retrieve the capacity CCU of the current account, so that I can use it to minus the CountOnPlayers to know a snapshot information of the available seats?0
-
Sorry, the CCU limit can't be fetched from the server. But when it's hit, new players will get a suitable error (see: Photon.PunBehaviour.OnPhotonMaxCccuReached()).
Your boss can monitor CCU from the Dashboard and there it's obvious how many CCU you got and how many are used. I wouldn't show this in the client.0