邀请被接受后,本地玩家应该怎么做? (游戏中心)

时间:2014-06-15 08:38:14

标签: ios objective-c xcode

我正在使用Game Center制作我的第一个iPhone多人游戏。我已经设置好所有工作都在期待邀请。到目前为止,当我收到邀请并接受邀请时,接受姓名的玩家会出现在另一台设备上。但是,在接受邀请的设备上没有任何事情发生。我应该做什么?我正在寻找像" localPlayerDidAcceptInvite"这样的方法。

   - (void)player:(GKPlayer *)player didAcceptInvite:(GKInvite *)invite {
        // Called when another player accepts a match invite from the local player.

        NSLog(@"[GCManager] didAcceptInvite:");

    //if ([self.multiplayerDelegate respondsToSelector:@selector(gameCenterManager:match:didAcceptMatchInvitation:player:)])
        [self.multiplayerDelegate gameCenterManager:self match:self.multiplayerMatch didAcceptMatchInvitation:invite player:player];
}

    - (void)player:(GKPlayer *)player didRequestMatchWithPlayers:(NSArray *)playerIDsToInvite {
        // Called when the local player starts a match with another player from Game Center.
        // When this method is called, the game is launched from Game Center and starts the matchmaking process.

        NSLog(@"[GCManager] didRequestMatchWithPlayers:");

        if ([self.multiplayerDelegate respondsToSelector:@selector(gameCenterManager:match:didRecieveMatchInvitationForPlayer:playersToInvite:)])
            [self.multiplayerDelegate gameCenterManager:self match:self.multiplayerMatch didRecieveMatchInvitationForPlayer:player playersToInvite:playerIDsToInvite];
    }

0 个答案:

没有答案