Game Center multiplayer, very long connection timeout

1.3k Views Asked by At

I've implemented a 2-player turnbased game using Game Center matchmaking/multiplayer, in other words using GKMatch. It works well. There is just one issue: when one player disconnects (ie. quits the app), it takes a while before the other players gets notified of this (with match:player:didChangeState:). Sometimes even 30 seconds.

That is not a good UX. I don't want a player to wait for nothing if the other player already disconnected 30 seconds ago.

2 questions:

  • Is this an issue with the sandbox server only?
  • If not, what can I do to shorten/eliminate this waiting period?
1

There are 1 best solutions below

6
On BEST ANSWER

I did not rely on GC's notifyPlayer.. Everything from DC to quit game to receive calls i handle by my own codes..

for my code, when player A presses home button, means in app delegate's applicationDidEnterBackground, a data is sent to the player B to inform that player A has quit the game. This way, when the player A quits, player B will immediately know that player A has quit.. Rather than waiting for gamecenter to notify you..