This is a follow-up to this question. If you are not receiving any callbacks to handleTurnEventForMatch:didBecomeActive:
, try the answer there.
In my game, I am only receiving turn event notifications some of the time. But if I go back to the matchMakerViewController
and re-load the match, the state is always correct.
My game uploads the turn state multiple times during each turn. Anecdotally, it seems that if the other device receives one notification for an opponent's turn, it is less likely to receive further notifications for that same turn. However, this is not 100%.
In general, my internet connection seems to work pretty well.
Any ideas what might be causing this?
I finally figured out the problem.
Alright, if you use the GKTurnBasedMatchmakerViewController
, then it steals the delegation from your current delegate.
It has probably got something like:
[GKTurnBasedEventHandler sharedTurnBasedEventHandler].delegate = self;
This makes perfect sense as the viewcontroller needs to update when changes occur from gamecenter, so it becomes the delegate for the GKTurnBasedEventHandler
.
If you want to return the delegation to your own object though you should put this line:
[GKTurnBasedEventHandler sharedTurnBasedEventHandler].delegate = self;
At the very top of all function in the GKTurnBasedMatchmakerViewControllerDelegate
protocol.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With