是否有可能创建一个回合制的匹配,玩家可以在其中查看特定的机器用户帐户'在游戏中心?
我正在制作回合制游戏,并希望让最终用户能够与机器对战。因此,我为我的机器创建了一个游戏中心帐户。
在我的GKTurnBasedMatch中,我有我的GKTurnBasedParticipant
_match.participants
遍历所有参与者,我看到机器播放器ID是:
_match.currentParticipant.player.playerID
8027277420
我还尝试输入实时和沙盒帐户的电子邮件地址:AppEnemy1Sand@gmail.com和AppEnemy1@gmail.com
我在模拟器上运行
但是,当我请求开始比赛时,参加者是我的机器,
-(void) playComputerWithNumberOfEnemiesEqualTo:(int) numberOfEnemies
{
if(numberOfEnemies > 0 && numberOfEnemies <= 3)
{
if([GKLocalPlayer localPlayer].isAuthenticated)
{
[GKPlayer loadPlayersForIdentifiers:@[@"AppEnemy1Sand@gmail.com"] withCompletionHandler:^(NSArray<GKPlayer *> * _Nullable players, NSError * _Nullable error)
{
NSLog(@"players %@",players);
NSLog(@"EE %@",error);
}];
}
}
}
错误如下:
Domain=GKErrorDomain Code=8 "The requested operation could not be completed because the player is invalid." UserInfo={GKServerStatusCode=5005, NSUnderlyingError=0x7896f570 {Error Domain=GKServerErrorDomain Code=5005 "status = 5005, NO SUCH PLAYER ID" UserInfo={GKServerStatusCode=5005, NSLocalizedFailureReason=status = 5005, NO SUCH PLAYER ID}}