gkmatchmaker

How is GKTurnBasedMatchmaker used?

风流意气都作罢 提交于 2020-02-08 07:54:09
问题 I'm trying to create a simple turn based 2 player game, but am struggling to understand how to use GKTurnBasedMatchmaker Here's the steps I have so far: Authenticate Local Player Make my view controller the GKTurnbasedMatchmakerViewControllerDelegate Present the matchmaking view controller like so: self.match.minPlayers = 2; self.match.maxPlayers = 2; self.match.defaultNumberOfPlayers = 2; let mmVC = GKTurnBasedMatchmakerViewController(matchRequest: match); mmVC.turnBasedMatchmakerDelegate =

How is GKTurnBasedMatchmaker used?

我的梦境 提交于 2020-02-08 07:51:26
问题 I'm trying to create a simple turn based 2 player game, but am struggling to understand how to use GKTurnBasedMatchmaker Here's the steps I have so far: Authenticate Local Player Make my view controller the GKTurnbasedMatchmakerViewControllerDelegate Present the matchmaking view controller like so: self.match.minPlayers = 2; self.match.maxPlayers = 2; self.match.defaultNumberOfPlayers = 2; let mmVC = GKTurnBasedMatchmakerViewController(matchRequest: match); mmVC.turnBasedMatchmakerDelegate =

iOS Gamecenter Programmatic Matchmaking

情到浓时终转凉″ 提交于 2020-02-05 04:24:07
问题 I'm trying to implement a real-time multiplayer game with a custom UI (no GKMatchMakerViewController ). I'm using startBrowsingForNearbyPlayersWithReachableHandler: ^(NSString *playerID, BOOL reachable) to find a local player, and then initiating a match request with the GKMatchmaker singleton (which I have already initiated). Here's where I'm having trouble. When I send a request, the completion handler fires almost immediately, without an error, and the match it returns has an expected

Game Center inviting friends programmatically

ぃ、小莉子 提交于 2019-12-21 17:55:49
问题 I'm facing difficulty inviting a friend to the match. GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease]; request.minPlayers = 2; request.maxPlayers = 2; request.playersToInvite = [NSArray arrayWithObjects: @"G:1102359306",nil ]; // GKMatchmakerViewController *mv = [[GKMatchmakerViewController alloc] initWithMatchRequest:request]; // [self presentModalViewController:mv animated:YES]; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request withCompletionHandler:^

iOS Game Center GameKit Programmatic Invite Matchmaking

半腔热情 提交于 2019-12-03 09:53:52
问题 I'm trying to implement a real-time multiplayer game with a custom UI (no GKMatchMakerViewController). I'm using startBrowsingForNearbyPlayersWithReachableHandler: ^(NSString *playerID, BOOL reachable) to find a local player, and then initiating a match request with the GKMatchmaker singleton (which I have already initiated). Here's where I'm having trouble. When I send a request, the completion handler fires almost immediately, without an error, and the match it returns has an expected

ios: programmatically ask for Game Center sign-in?

女生的网名这么多〃 提交于 2019-11-30 20:12:15
I have a simple question, but I’ve looked through Apple’s documentation and done some searching and I can’t find the answer to it. Is it possible to programmatically pull up Game Center’s sign-in view? I have a UIButton that requires Game Center, and if the client does not sign in when the app is opened (iOS pulls up the sign-in view at launch), I want to provide a second chance for the user to sign in. I'm assuming you're calling this GKLocalPlayer method on launch: -setAuthenticateHandler: (>= iOS7) or -authenticateWithCompletionHandler: (<= iOS6) If the user cancels the presented login

ios: programmatically ask for Game Center sign-in?

心已入冬 提交于 2019-11-30 04:29:12
问题 I have a simple question, but I’ve looked through Apple’s documentation and done some searching and I can’t find the answer to it. Is it possible to programmatically pull up Game Center’s sign-in view? I have a UIButton that requires Game Center, and if the client does not sign in when the app is opened (iOS pulls up the sign-in view at launch), I want to provide a second chance for the user to sign in. 回答1: I'm assuming you're calling this GKLocalPlayer method on launch: