Turn Based Participant Timeout Date Always NULL
Asked Answered
A

1

6

Have been working on a two-player turn based game that uses a custom UI for match management. Considering restricting the app to iOS 6+ in order to use player timeouts. I would like to show the user the remaining amount of time to move, but the participant.timeoutDate is always null? Per the WWDC 2012 video (that says the timeout won't apply to the last participant in nextParticipants), I pass an array with two entries (opponent at index 0 and local player at index 1) when calling endTurnWithNextParticipants:turnTimeout:matchData:completionHandler: to take a turn. I've tried both GKTurnTimeoutDefault and various integer literals ... no luck ... always seems to be null. The player's last turn date works fine.

On the subject of player timeouts ... after I get them working, how is this delivered? I see GKTurnBasedMatchOutcomeTimeExpired ... does this come in a turn event?

Amberambergris answered 3/12, 2012 at 18:27 Comment(1)
Have you ever made any progress with this issue? I am facing the exact same thing. All my timeout dates are null even when setting a timeout interval.Zootechnics
C
1

From Apple's developer forum

Elian Gidoni -

+1 The doc should be: timeoutDate The date and time when the participant’s turn timed out. (read-only)

Culvert answered 17/10, 2014 at 18:41 Comment(1)
It also appears that once a user times out, their timeout value is always set to that value, even when a new turn starts, unless/until they timeout again. I started checking if timeout was nil to determine if a player had timedout and found that once set, it never goes back to nil ever again. If you need to know that someone timedout on any given turn, you'll need to track that yourself in the matchData.Pippin

© 2022 - 2024 — McMap. All rights reserved.