3

I' m working on a gamekit turnbased match. It's a wordgame in different languages.

The player has the option to set the language for every game he wants to play. I would like to use the GKMatchRequest's playergroup property to differentiate between the languages.

But after the GKMatchRequest has been sent and I receive a GKTurnBasedMatch object, how can I tell which playergroup (language) belongs to that match ? As far as I know, the GKTurnBasedMatch object doesn't have the playergroup property nor can I match a GKTurnBasedMatch object with a GKMatchRequest, there's no identifier.

Thunk
  • 4,099
  • 7
  • 28
  • 47
Marc Denessen
  • 201
  • 2
  • 4

2 Answers2

1

Although there isn't a playerGroup property in a GKTurnBasedMatch object, I recommend storing the playerGroup of the match in the matchData property.

codeperson
  • 8,050
  • 5
  • 32
  • 51
0

The GKTurnBasedMatch you receive is of the playerGroup you requested. If you set your playerGroup to 1, the GKTurnBasedMatch you get back will only pair up when someone else requests a match with a playerGroup of 1.

From the documentation: "If your application sets the playerGroup property, only players whose requests share the same playerGroup value are automatched by Game Center"

Nortiest
  • 64
  • 3