gkturnbasedmatch

GKTurnBasedEventListener could not be set to delegate of my ViewController?

早过忘川 提交于 2020-01-05 07:07:18
问题 In objC the syntax written by Rawendrich for GKTurnBasedEventListener , which was GKTurnBasedEventHandler there at that time, now changed by Apple is as below. if (!gameCenterAvailable) return; void (^setGKEventHandlerDelegate)(NSError *) = ^ (NSError *error) { GKTurnBasedEventHandler *ev = [GKTurnBasedEventHandler sharedTurnBasedEventHandler]; ev.delegate = self; }; NSLog(@"Authenticating local user..."); if ([GKLocalPlayer localPlayer].authenticated == NO) { [[GKLocalPlayer localPlayer]

GameKit Turn-based listener is not reliably called when matchData changes

吃可爱长大的小学妹 提交于 2020-01-03 02:41:10
问题 I am using Game Center turn-based matches for my card game. It feels like a good fit because people want to check their email or write a text sometimes between turns. Some users have said that they do really want to be able to have a very asynchronous playing experience. For the people that are keeping the game open between their turns, I want to update the screen to reflect things that the other players are doing on their turns. I have set up a listener on GKLocalPlayer that responds to

Player swipe to remove match

守給你的承諾、 提交于 2019-12-23 18:54:29
问题 Let's say I have a turn based match with two players. At some point player 1 recognizes that he is about to lose the game. When it is Player 1's turn, he uses Game Center App to do a swipe to remove the match. Issues: A. Take turn timer never expires on Player 1. So the match's turn will not switch to Player 2 when the time expired. B. The game also offers a view only mode so players can view the game progress while he is out of turn. But since no status was updated to indicate that Player 1

How do I identify an empty NSData Object that appears as empty brackets?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 08:12:32
问题 I am dealing with a corruption issue in Game Kit's GKTurnBasedMatch class (see this thread) which sometimes results in an invalid game state, with corrupted matchData. So as a workaround, I'm creating a way out a way to identify these invalid matches so I can deal with them appropriately. The corrupted matchData seems like a good way to do this. However, so far I've been unable to identify them. When I do this: // "match" is an existing GKTurnBasedMatch object NSLog(@"match data is: %@",

How do I reply to a GKTurnBasedExchange? GKLocalPlayerListener delegate receivedExchangeReplies is called intermittently

余生颓废 提交于 2019-12-19 10:23:07
问题 There are a handful of posts discussing how Game Center's push notifications were fairly unreliable in the sandbox. However, the sandbox is obfuscated with iOS 9 so, I'm not sure why my Game Center push notifications are so unreliable. When I reply to the active exchange, the sender is rarely notified. [exchange replyWithLocalizableMessageKey:@"EXCHANGE_REPLY" arguments:@[] data:data completionHandler:^(NSError *error) { if (error) { NSLog(@""); } }]; On the senders device, if I refresh the

GKTurnBasedMatch receive data

﹥>﹥吖頭↗ 提交于 2019-12-12 14:17:50
问题 I am trying to implement a turn-based app, and there is no problem with sending turn data, but I see no way of receiving data automatically. So far, I have found out that much: There is a GKTurnBasedEventHandlerDelegate -protocol. It is easy to implement, but where do I set that object to be a delegate of whatever it has to be a delegate of? It does not seem to be a delegate of GKTurnBasedMatch , or GKTurnBasedMatchmakerViewController , or GKMatchMaker . There is also a method of

Turn-based matchmaking not working in iOS 10

蹲街弑〆低调 提交于 2019-12-08 03:16:43
问题 My game was working fine before iOS 10. Now, everyone with iOS 10 can't invite and play with who they want. When a user says they want to play multiplayer, I create a GKMatchRequest like this: GKMatchRequest *request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 4; request.defaultNumberOfPlayers = 2; I use a GKTurnBasedMatchmakerViewController to handle the invitation, etc. The user sees an interface that would let them change the number of players in the match

Turn-based matchmaking not working in iOS 10

ε祈祈猫儿з 提交于 2019-12-06 05:15:25
My game was working fine before iOS 10. Now, everyone with iOS 10 can't invite and play with who they want. When a user says they want to play multiplayer, I create a GKMatchRequest like this: GKMatchRequest *request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 4; request.defaultNumberOfPlayers = 2; I use a GKTurnBasedMatchmakerViewController to handle the invitation, etc. The user sees an interface that would let them change the number of players in the match and invite players. Let's say that they only want 2 players, so they leave that and they want to play

Handle invitation to GKTurnBasedMatch without game center view controllers

我与影子孤独终老i 提交于 2019-12-06 03:29:10
问题 I am working on a simple turn-based word game, and I'm having a difficult time figuring out how invitations are working. When user A invites user B to a game, I want user B to be able to see this game in my custom match interface (ie a screen where all of user B's games are listed). Things are fine if user B clicks on the notification when he is invited to a game, but I still want the game to be visible through my own interface if user B just navigates to the app on his own. Whenever this

IOS Game Center GKLocalPlayerListener

喜你入骨 提交于 2019-12-04 10:41:50
问题 I was trying to implement an event listener in a turn based game so a player can receive when his turn is active or when he is invited by a friend. GKTurnBasedEventHandler is deprecated in IOS 7 and i read in the documentation that i should use GKLocalPlayerListener; but that's the extend of it. Is there someone who used it already, because there is no info anywhere. This is what i tried before, and it does not work. - (BOOL)application:(UIApplication *)application