HandleTurnEventForMatch: didBecomeActive: callbacks only arrive for a while

This is a continuation of this issue . If you did not receive any handleTurnEventForMatch:didBecomeActive: , try answering there.

In my game, I only get notifications of queue events for a while. But if I go back to matchMakerViewController and matchMakerViewController match, the state is always correct.

My game loads a turn state several times during each turn. Anecdotally, it seems that if another device receives one notification to turn the enemy, it is unlikely to receive further notifications for the same move. However, this is not 100%.

All in all, my internet connection seems to work very well.

Any ideas what could be causing this?

+7
source share
1 answer

I finally understood the problem.

Well, if you use the GKTurnBasedMatchmakerViewController , then it steals a delegation from your current delegate.

He probably has something like:

 [GKTurnBasedEventHandler sharedTurnBasedEventHandler].delegate = self; 

This makes sense since the viewcontroller needs to be updated when changes come from the gamecenter, so it becomes a delegate to the GKTurnBasedEventHandler .

If you want to return the delegation to your own object, although you should put this line:

 [GKTurnBasedEventHandler sharedTurnBasedEventHandler].delegate = self; 

At the very top of the entire function in the GKTurnBasedMatchmakerViewControllerDelegate protocol.

+8
source