1

I want to implement a turn timeout feature in my game center app. It should give each user a 30-60 sec time to complete their turn and if not they should be treated as they quit. I tried using the timeout parameter of endTurnWithNextParticipants but it doesn't seem effective with small values. It never signals a turn timeout, afais the default value for it is 1 week (GKTurnTimeoutDefault). So I guess apple had different ideas than mine while using the name turnbasedmatch.

My best bet is to set a timer when user receives the turn for 30-60 secs, and if user does not make a turn in that period, fire one of the participant quit methods. But it is not a reliable solution because users may run out of batteries, turn off the phone also nstimer seems to pause ticking during uitouchevents (uiscrollview scrolling etc, maybe it can be handled by running nstimer in another thread i don't know). Any tips on implementing turn time out reliably?

guenis
  • 2,520
  • 2
  • 25
  • 37
  • 3
    I got a response in the apple developer forums (possibly from an apple employee), _"If your intent is that playing your game requires the dedicated/exclusive attention of all players for the duration of the game, then it might be worth considering whether to use the real-time multiplayer API instead."_ so i decided to switch to real-time api and things are working better – guenis Jun 28 '13 at 00:17
  • You could write this as an answer with some code snippets as tips for others – tipycalFlow Mar 29 '15 at 13:22

0 Answers0