-1

I am working on a turn-based multiplayer game using game center. The game also use Spanish localisation. It is enabled by reading the device language settings. Now my requirement is: When i start a turn based match, my opponent should have the same language setting in his/her phone as I am having. How can I make this possible.

I use the following code to connect

- (void)findTurnBasedMatchWithViewcontroller:(UIViewController *)viewController forDelegate:(id)argDelegate {
self.delegate = argDelegate;
presentingViewController = viewController;
GKMatchRequest *request = [[GKMatchRequest alloc] init];
request.minPlayers = 2;
request.maxPlayers = 2;
[manager setCurrentGameType:kTurnBased];
GKTurnBasedMatchmakerViewController *mmvc = [[GKTurnBasedMatchmakerViewController alloc] initWithMatchRequest:request];
mmvc.turnBasedMatchmakerDelegate = self;
mmvc.showExistingMatches = NO;
[presentingViewController presentViewController:mmvc animated:YES completion:^(void) {

 }];
}
Abin George
  • 101
  • 2
  • I never wrote a single line of code for iOS in my life. Still I was able to answer this question just by looking up the documentation. So I am afraid I have to downvote this question because it "does not show any research effort". When I was able to find an answer without knowing anything at all about the technology involved, you should have been able to do the same. – Philipp Jun 13 '14 at 09:19

1 Answers1

0

You can do this by setting the request.playerGroup property to different values depending on the users language. An excerpt from the documentation of GKMatchRequest:

playerGroup

A number identifying a subset of players allowed to join the match.

@property(nonatomic, assign) NSUInteger playerGroup

If your game sets the playerGroup property, only players whose requests share the same playerGroup value are automatched by Game Center. The value of a player group is arbitrary.

Philipp
  • 119,250
  • 27
  • 256
  • 336