Is it possible to create a turn-based match where players would verse specific 'machine user accounts' in game-center?
I'm making a turn-based game and wanting to allow the end-user to play against the machine. Therefore I created a game center account for my machine.
In my GKTurnBasedMatch, I have my GKTurnBasedParticipant in
_match.participants
iterating through all participants, i see the machine player ID is:
_match.currentParticipant.player.playerID
8027277420
I also tried putting in the email address for live and sandbox accounts: [email protected] and [email protected]
I am running on simulator
However when I request to start a match, where the participant is my machine, with
-(void) playComputerWithNumberOfEnemiesEqualTo:(int) numberOfEnemies
{
if(numberOfEnemies > 0 && numberOfEnemies <= 3)
{
if([GKLocalPlayer localPlayer].isAuthenticated)
{
[GKPlayer loadPlayersForIdentifiers:@[@"[email protected]"] withCompletionHandler:^(NSArray<GKPlayer *> * _Nullable players, NSError * _Nullable error)
{
NSLog(@"players %@",players);
NSLog(@"EE %@",error);
}];
}
}
}
The error reads:
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}}