How to determine if a customer intends to intentionally leave Room in Google Play Games in real time?

Here is a multiplayer game, and I need to display two notifications for the player: first when an opponent is disconnected due to some network issues, and second when he deliberately left the game. Number created with auto-match criteria (maximum number of players - 2). And every time one of the players leaves the game due to a network problem or deliberately RoomStatusUpdateListener

callbacks called in the following order: onDisconnectedFromRoom

, onPeerLeft

, onPeersDisconnected

.

So, I am showing the notification in the callback onDisconnectedFromRoom

, the problem is that you cannot determine if the problem was with the network that was with the rival, or if it deliberately left. Participant.getStatus()

returns STATUS_JOINED

.

So how do you determine if a client intends to leave the premises?

Thank you in advance!

+3


source to share


1 answer


you can send game data between clients. So just in case a player wants to leave the game, send a message that this user will disconnect from all other players.



the best, Steve.

+2


source







All Articles