所以我的比赛有两名球员。当玩家 1 创建一个新匹配时,我使用endTurnWithNextParticipants
方法并为 nextParticipants 提供 GKTurnBasedMatch 的参与者数组属性,该属性有两个参与者。
但是在播放器 1 设备上,它一直说轮到你了。玩家 2 的设备上显示“轮到他们了”。
- (void)endTurnWithNextParticipants:(NSArray<GKTurnBasedParticipant *> *)nextParticipants
turnTimeout:(NSTimeInterval)timeout
matchData:(NSData *)matchData
completionHandler:(void (^)(NSError *error))completionHandler
有什么建议么?
编辑:
这是我使用的方式endTurnWithNextParticipants
。currentTurnBasedMatch
是 GKTurnBasedMatch 的一个实例。我确实验证了该实例确实包含两个参与者(玩家 1 和 2)正确。并且完成没有任何错误。
[self.currentTurnBasedMatch endTurnWithNextParticipants:self.currentTurnBasedMatch.participants turnTimeout:GKTurnTimeoutDefault matchData:data completionHandler:^(NSError * _Nullable error) {
MyNSLogSys2O(@"completion error:", error); //default 1 week timeout
}];