1

I've been developing a card game that uses the google play real time multiplayer api for allowing players to compete in card tournaments against one another. I've gotten to the latter stages of the development process but I recently came across an issue that I'd love to resolve soonest.

The tournaments consists of rounds, and if a player disconnects during a round, the others are notified through the onPeerLeft method, and the round ends, with the remaining players moving to the next round. Simple enough, but in cases whereby a users network/wifi fluctuates or goes off (which is quite common in my country), the multiplayer room become non responsive for that player alone. Sometimes, it recovers, but some times, it doesn't and the game is just on hold (when it comes to that users turn).

The room doesn't disconnect the player, as mentioned in the comments on the first answer in this previous post: Detect if other player left unintentionally (e.g. internet disconnection) and reconnect - Google play real time multiplayer

So I have to make a hard decision of disconnecting a player automatically, if they don't make a move within 15 secs (apparently this is the time limit a player's network can go down before it no longer receives messages from that room when the network comes back online). But the google play games connection is P2P and I can't establish a server to time each user when it gets to their turn. Any help or direction concerning this dilemma would be much needed.

Mofe Ejegi
  • 733
  • 11
  • 20
  • I suppose your client could make an assumption that if a player hasn't responded in 15 seconds, they'll ignore them from the game. I know it'd be much nicer to delegate this functionality to the server, but if that's not an option, this would definitely work. – Mapsy Jul 05 '17 at 21:16
  • ... or, clients could make a request that the server check whether the player is still connected after this interval, and have it generate a response indicating the result? – Mapsy Jul 05 '17 at 21:17
  • Thanks for the response, thing is... the inactive client, for some reason, still maintains the STATUS_JOINED status for a while, even though they're unable to send and receive messages from the room anymore – Mofe Ejegi Jul 05 '17 at 21:19
  • 1
    I was thinking that after every player makes a move, he places a check on the next person and times him/her, then if nothing happens, what you mentioned in your first comment, takes place. But yeah...., trusting the client ain't too cool – Mofe Ejegi Jul 05 '17 at 21:22

0 Answers0