game-center - Game Center 回合制自动匹配不工作

标签 game-center gamekit

我使用的是标准匹配用户界面和两台 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];
}

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

最佳答案

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

尝试在一台设备上创建匹配项并使用该设备完成一个回合,即当您调用...

 endTurnWithNextParticipants:turnTimeout:matchData:completionHandler:

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

关于game-center - Game Center 回合制自动匹配不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13420757/

相关文章:

ios - 回合制游戏中心在离线时显示不正确的游戏状态

android - Libgdx:屏幕管理器

ios - 游戏中心如何离线工作?

iphone - 如何从 GKTurnBasedMatch 检索 playerGroup 属性?

iOS Game Center GKScore上下文,如何编码信息?

iphone - iOS 上的蓝牙连接 - 建立连接时应用程序崩溃

objective-c - 删除 WithCompletionHandler 错误

ios7 - Zombie in Game Center 的 [addPlayersToMatch] 在一个 20-liner 项目中

GameKit 转超时

ios - 在完成处理程序中修改可变对象