Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to detect if client intentionally left Room in Google Play Games Real-time Multiplayer?

Here is a multiplayer game and I need to display two notifications to player: first when rival disconnected due to some networking problems, and second - when he left game intentionally. Room is created with auto-match criteria (max players - 2). And each time when one of the players left game due to network problems or intentionally RoomStatusUpdateListener callbacks called in the next order: onDisconnectedFromRoom, onPeerLeft, onPeersDisconnected.

So I show notification in onDisconnectedFromRoom callback, the problem is you can't detect if it was network problem that happened to rival or he left intentionally. Participant.getStatus() returns STATUS_JOINED.

So, how to detect if client left room intentionally?

Thank you in advance!

like image 421
Roman Avatar asked Dec 09 '25 23:12

Roman


1 Answers

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

best whishes, Steve.

like image 145
JacksOnF1re Avatar answered Dec 12 '25 13:12

JacksOnF1re



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!