GameCenter实时匹配不会启动,卡在连接上,在应用商店中不在沙箱中

时间:2013-01-13 11:49:36

标签: ios ios5 ios6 ios-simulator game-center

我在提交它之前测试过,它在iOS 6上运行模拟器,但在5.1上它不会工作因为expectedPlayerCount总是出现1而不是0!就在5.1 !! 我搜索了问题,开发人员说它的网络问题和沙箱问题,所以我提交了我的应用程序,它得到了批准!现在我尝试了它,它始终坚持连接!!!

  • (void)findMatchWithMinPlayers:(int)minPlayers maxPlayers:(int)maxPlayers viewController:(UIViewController *)viewController委托:(id)theDelegate {

    if(!gameCenterAvailable)返回;

    matchStarted = NO; self.match = nil; self.presentingViewController = viewController; delegate = theDelegate;

    if(pendingInvite!= nil){

    [presentingViewController dismissModalViewControllerAnimated:NO];
    NSLog(@"findmatch");
    GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithInvite:pendingInvite] ;
    mmvc.matchmakerDelegate = self;
    [presentingViewController presentModalViewController:mmvc animated:YES];
    
    self.pendingInvite = nil;
    self.pendingPlayersToInvite = nil;
    

    }其他{

    [presentingViewController dismissModalViewControllerAnimated:NO];
    NSLog(@"findmatch2");
    GKMatchRequest *request = [[GKMatchRequest alloc] init] ;
    request.minPlayers = minPlayers;
    request.maxPlayers = maxPlayers;
    request.playersToInvite = pendingPlayersToInvite;
    
    GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithMatchRequest:request];
    mmvc.matchmakerDelegate = self;
    
    [presentingViewController presentModalViewController:mmvc animated:YES];
    
    self.pendingInvite = nil;
    self.pendingPlayersToInvite = nil;
    

    }

}

  • (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)theMatch { 的NSLog(@ “%d”,theMatch.expectedPlayerCount); [presentingViewController dismissModalViewControllerAnimated:YES]; 的NSLog(@ “didfind”); self.match = theMatch; 的NSLog(@ “%d”,match.expectedPlayerCount); match.delegate = self; if(!matchStarted&& match.expectedPlayerCount == 0){     NSLog(@“准备开始比赛!”);     [self lookupPlayers]; } }

请帮助我收到这么多错误评论!!

1 个答案:

答案 0 :(得分:0)

现在可能来不及帮助你,但是你确定在iTunes Connect的两个地方启用了Game Center吗?这篇文章:https://devforums.apple.com/thread/66773?tstart=0

告诉您在“管理游戏中心”部分和您要上传的版本中启用(否则它可能在沙箱中工作但在应用商店中不起作用)

希望它有所帮助!