Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-21-2011, 11:12 AM   #1 (permalink)
Registered Member
 
doffing81's Avatar
 
Join Date: Nov 2010
Posts: 55
doffing81 is on a distinguished road
Default Game Center Match Object Created but Starting the Match?

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??
doffing81 is offline   Reply With Quote
Old 02-21-2011, 11:19 AM   #2 (permalink)
Registered Member
 
doffing81's Avatar
 
Join Date: Nov 2010
Posts: 55
doffing81 is on a distinguished road
Default

If the expectedPlayerCount is down to 0, aren't the players considered to be connected, or rather hasn't the match started, and the code I want to run (yet isn't)

match: player: didChangeState:

is unnecessary, or does it still need to be intitialized, and players connected to? I just can't get to the point of sending and receiving data.
doffing81 is offline   Reply With Quote
Old 02-21-2011, 05:47 PM   #3 (permalink)
Registered Member
 
doffing81's Avatar
 
Join Date: Nov 2010
Posts: 55
doffing81 is on a distinguished road
Default

Ahhh, forgot:

self.p2pMatch.delegate = self;
doffing81 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 426
8 members and 418 guests
chemistry, ChrisYates, hussain1982, Retouchable, skrew88, SLIC, walex, xzoonxoom
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,679
Threads: 94,128
Posts: 402,921
Top Poster: BrianSlick (7,990)
Welcome to our newest member, xzoonxoom
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 08:11 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0