小编mbr*_*rmj的帖子

游戏中心回合制自动匹配不起作用

我正在使用标准配对用户界面和两个 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];
}
Run Code Online (Sandbox Code Playgroud)

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

gamekit game-center

3
推荐指数
1
解决办法
443
查看次数

标签 统计

game-center ×1

gamekit ×1