似乎GameKit只允许GKTurnBasedMatch在每次从游戏中心服务器加载GKTurnBasedMatch时更新一次。是否有其他方法可以更新matchData属性?
发布于 2013-02-18 16:52:53
以下方法已添加到iOS 6.0中的GKTurnBasedMatch中,并将执行您所需的操作:
- (void)saveCurrentTurnWithMatchData:(NSData *)matchData
completionHandler:(void (^)(NSError *error))completionHandler“更新比赛数据,而不将游戏提前给其他玩家”
发布于 2012-02-14 04:35:43
你可以调用`-
[GKTurnBasedMatch (void)loadMatchDataWithCompletionHandler:(void (^)(NSData *matchData, NSError *error))completionHandler];只要你想获得更新的matchData,随时都可以。如果你想做增量移动,你也可以这样做-
[GKTunrBasedMatch - (void)endTurnWithNextParticipant:(GKTurnBasedParticipant *)nextParticipant matchData:(NSData *)matchData completionHandler:(void (^)(NSError *error))completionHandler];将您自己的参与者作为下一个参与者。但是,在提交部分移动后,您必须再次执行loadMatchDataWithCompletionhandler:才能提交下一个移动部分。
https://stackoverflow.com/questions/8469093
复制相似问题