我正在使用gamecenter创建一款游戏Now它是一款基于回合的游戏,我邀请玩家参加比赛。最小值为2,最大值为7.它在ios5中工作正常,但是当我在ios6中运行应用程序时,我只邀请了2个玩家,但它在sanbox中自动匹配最多7个玩家。
邀请玩家的方法不会弃用,它位于以下位置:
- (void)findMatchWithMinPlayers:(int)minPlayers maxPlayers:(int)maxPlayers viewController:(UIViewController *)viewController {
if (!gameCenterAvailable) return;
presentingViewController = viewController;
GKMatchRequest *request = [[GKMatchRequest alloc] init];
request.minPlayers = 2;
request.maxPlayers = 7;
}
如何限制仅限受邀玩家的玩家数量,而不是自动匹配玩家。我怎么会得到这个?
答案 0 :(得分:0)
代码不足以获得想法。
但我在逻辑上给你的想法是你想要最少2名玩家和最多7名玩家。
然后你应该使用像 - >这样的条件min> = 2且max< = 7然后选择播放器ll在该条件内。
所以你将获得玩家最小2和最大7。
可以吗?