3

我正在使用标准配对用户界面和两台 iPad iOS6。问题是当我在第一个设备中创建新匹配时,第二个设备应该在我查看匹配用户界面时看到现有匹配,但事实并非如此。我确定我的代码是正确的。这是方法:

-(void)findMatchWithMinPlayers:(int)minPlayers maxPlayers:(int)maxPlayers viewController:(UIViewController*)viewController {

    // the view that will present Matchmaker View Controller
    self.viewCaller = viewController;

    GKMatchRequest *request = [[GKMatchRequest alloc] init];
    request.minPlayers = minPlayers;
    request.maxPlayers = maxPlayers;

    GKTurnBasedMatchmakerViewController *viewMatchmaker = [[GKTurnBasedMatchmakerViewController alloc] initWithMatchRequest:request];
    viewMatchmaker.turnBasedMatchmakerDelegate = self;
    viewMatchmaker.showExistingMatches = YES;
    [self.viewCaller presentViewController:viewMatchmaker animated:YES completion:nil];
}

我什至尝试了两个不同的示例游戏但同样的问题,那么我该如何解决呢?

4

1 回答 1

5

当 Gamekit 为回合制比赛做媒人时,它试图找到一个有空位的比赛来填补玩家。如果它找不到一个空位来填补玩家,则创建一个新的比赛。

尝试在一台设备上创建匹配并使用该设备转一圈,即当您调用...

 endTurnWithNextParticipants:turnTimeout:matchData:completionHandler:

然后在另一台设备上尝试寻找匹配项。

于 2012-12-10T16:56:30.633 回答