我正在摆弄一个简单的多人游戏使用游戏中心。我在使用苹果公司的代码。我只是把最大球员的数量改为5名,而不是2名:
- (void)hostMatch:(id)sender
{
GKMatchRequest *request = [[GKMatchRequest alloc] init];
request.minPlayers = 2;
request.maxPlayers = 5;
GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithMatchRequest:request];
mmvc.matchmakerDelegate = self;
[self presentViewController:mmvc animated:YES completion:nil];
}当request.maxPlayers等于2-4时,它工作得很好,但是一旦超过5,它就会给出以下错误:
The requested operation could not be completed because the match request is invalid.
有人想出解决办法了吗?
发布于 2013-12-09 06:31:38
这一切都取决于您正在创建的游戏类型。下表是苹果公司的:
表7-3 每一种比赛的最大玩家数 匹配类型。最大玩家数 对等点4 主持。16 转向基础上。16
以下是进一步研究的链接:ref/doc/uid/TP40008304-CH12-SW7
https://stackoverflow.com/questions/20463858
复制相似问题