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!
source to share