mbr*_*rmj 3 gamekit game-center
我正在使用标准配对用户界面和两个 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)
我什至尝试了两个不同的示例游戏,但都出现了同样的问题,那么我该如何解决呢?
小智 5
当 Gamekit 为回合制比赛做媒人时,它试图找到一个有空位的匹配来填充玩家。如果它找不到空位来填充玩家,则创建一个新的匹配。
尝试在一台设备上创建匹配项并使用该设备完成一轮,即当您呼叫...
endTurnWithNextParticipants:turnTimeout:matchData:completionHandler:
Run Code Online (Sandbox Code Playgroud)
然后在另一台设备上尝试寻找匹配项。
| 归档时间: |
|
| 查看次数: |
443 次 |
| 最近记录: |