This is where I'm at. This code executes, and expectedPlayerCount goes down to 0, so is it safe to say the match was created?
Code:
- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)match
{
[self dismissModalViewControllerAnimated:YES];
self.p2pMatch = match; // Use a retaining property to retain the match.
// Start the game using the match.
NSLog(@"Start Match");
[self clearView];
[self.view insertSubview:mainGameScreen.view atIndex:0];
// Start the match.
NSLog(@"%i", p2pMatch.expectedPlayerCount);
}
but this code does not, which I thought would be done automatically?!?
Code:
- (void)match:(GKMatch *)match player:(NSString *)playerID didChangeState:(GKPlayerConnectionState)state
{
switch (state)
{
case GKPlayerStateConnected:
NSLog(@"Connected");
break;
case GKPlayerStateDisconnected:
// a player just disconnected.
NSLog(@"disConnected");
break;
}
/* if (!self.matchStarted && match.expectedPlayerCount == 0)
{
self.matchStarted = YES;
// handle initial match negotiation.
}*/
}
Could it be a delegation issue? Currently I have the mainViewController as the matchDelegate, should the new view (mainGameScreen) be the delegate? Or could it be something else I'm missing??