Questions tagged [gkturnbasedmatch]

The GKTurnBasedMatch class allows your game to implement turn-based matches between sets of players on Game Center. A turn-based match uses a store-and-forward approach to share data between the participants.

The GKTurnBasedMatch class allows your game to implement turn-based matches between sets of players on Game Center. A turn-based match uses a store-and-forward approach to share data between the participants.

When a player participating in the match performs actions that advance the state of the match, your game describes the new state of the match and decides which player acts next. The next player to act is notified by a push notification.

Later, when the next player launches your game, you download the match data from Game Center and continue the match. Players take turns acting (based on whatever internal logic your game implements) until the match ends.

One advantage of turn-based matches is that a player may participate in multiple matches simultaneously.

104 questions
10
votes
3 answers

IOS Game Center GKLocalPlayerListener

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…
Macaret
  • 797
  • 9
  • 33
8
votes
3 answers

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

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…
todd412
  • 1,308
  • 2
  • 17
  • 24
8
votes
1 answer

handleTurnEventForMatch:didBecomeActive: callbacks only arriving some of the time

This is a follow-up to this question. If you are not receiving any callbacks to handleTurnEventForMatch:didBecomeActive:, try the answer there. In my game, I am only receiving turn event notifications some of the time. But if I go back to the…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
7
votes
4 answers

Gamecenter ios 9 GameCenter GKLocalPlayerListener methods not called

This is about GameCenter. Since "the GKLocalPlayerListener protocol inherits the methods from GKChallengeListener, GKInviteEventListener, and GKTurnBasedEventListener. In order to handle multiple events" and "do not implement GKChallengeListener,…
μ4ρκ05
  • 585
  • 2
  • 5
  • 16
7
votes
3 answers

GKTurnBasedMatch push notifications are very inconsistent

I'm testing a turn based game between two devices. As far as I understand, sending a turn with [GKTurnBasedMatch endTurnWithNextParticipants:], for example, should automatically push a game center notification to the opponent. Sometimes, this…
cowfaboo
  • 709
  • 1
  • 8
  • 15
6
votes
2 answers

player:receivedTurnEventForMatch:didBecomeActive: inconsistently/rarely fires

I am currently testing my Game Center Aware App using the Game Center Sandbox, with one instance running on the iOS simulator and the other on an Retina iPad Mini. I have a view controller which needs to receive turn events, so I implement the…
Ben Pious
  • 4,765
  • 2
  • 22
  • 34
6
votes
2 answers

GKTurnBasedMatch participants are incorrect/duplicates

I am working on a turn-based GameCenter game. A GKTurnBasedMatch is created with a GKMatchRequest, with minPlayers and maxPlayers set to 2. I get an NSInvalidArgumentException while trying to end the game with endMatchInTurnWithMatchData, telling me…
Kirill E.
  • 338
  • 2
  • 9
5
votes
2 answers

How to list all available GKTurnBasedMatches for a player?

I'm building a game using Game Center's turn based matches. I want to display a list of all the available matches. I've tried using loadMatchesWithCompletionHandler(), but the array of games returns as nil, and the error also returns as nil. There…
coopersita
  • 5,011
  • 3
  • 27
  • 48
5
votes
1 answer

iOS game center -- frequent CONNECTION INTERRUPTED messages

I am working on an iOS game center game, using GKTurnBasedMatch. Every time an incomplete turn, there is a message in the console like this: 2013-04-26 19:26:45.115 AppName[6439:5a9f] CONNECTION INTERRUPTED Interestingly, this does not happen when…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
5
votes
2 answers

Handle invitation to GKTurnBasedMatch without game center view controllers

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…
cowfaboo
  • 709
  • 1
  • 8
  • 15
4
votes
0 answers

iOS Game Center GKTurnBasedMatchmakerViewController - works sometimes, fails others

I am working on the turned-based match app Wordiamo. It is networked through Game Center. I am having a problem inviting new players through the GKTurnBasedMatchmakerViewController. I deploy it with: let request = GKMatchRequest() …
cdub
  • 180
  • 1
  • 12
4
votes
1 answer

endMatchInTurnWithMatchData:completionHandler: Fails with invalid state

In my turn based game, I receive the following error indicating the session is in an invalid state and that the game is not active: 2014-06-26 15:46:04.684 myApp[14498:60b] Error Domain=GKErrorDomain Code=24 "The requested operation could not be…
JeffB6688
  • 3,782
  • 5
  • 38
  • 58
4
votes
0 answers

GKAchievement reportAchievements gives NSIllegalArgumentException

I implemented GKAchievement in a GKTurnBasedMatch and it was working initially. Now I am getting this error while reporting achievement for other player. Interestingly, same code awarding achievement to local Player Terminating app due to…
Hassan Jawed
  • 1,650
  • 1
  • 12
  • 19
4
votes
0 answers

iOS: Exclude players from GKTurnBasedMatch

I am building a 2 player game. I am using GKTurnBasedMatchmakerViewController to start matches. I would like to ensure that players can only have one game vs the same player. Currently if a player starts a game with someone they already have I just…
datinc
  • 3,404
  • 3
  • 24
  • 33
4
votes
1 answer

Game Center "the specified participant does not have the required turn state"

I am occasionally receiving the following error when I try to send a turn in a Sandbox Game Center turn based play game. Error Domain=GKErrorDomain Code=23 "The requested operation could not be completed because the specified participant does not…
Liam Flynn
  • 53
  • 1
  • 3
1
2 3 4 5 6 7