How do I identify if multi-player game is initiated by automatch or by inviting a friend ?
I have got this method called when the match starts:
- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)theMatch {
[presentingViewController dismissModalViewControllerAnimated:YES];
self.match = theMatch;
match.delegate = self;
if (!matchStarted && match.expectedPlayerCount == 0) {
NSLog(@"Ready to start match!");
[self lookupPlayers];
}
}
Basically i want this(please check this link) – how to sync data in multiplayer game(game-center ios)
I check if the local player’s playerID is contained in the match’s list of participants. I have found they are not be listed if they were invited or auto matched. I believe this is because they have not yet accepted the match.
If the payer decides to play the match, I call this for the match:
If they decline, I call this for the match: