我正在为棋盘游戏使用回合制比赛,当回合完成时,我调用 GKTurnBasedMatch.EndTurn 并将比赛参与者和新的比赛数据作为参数传递。我需要游戏向不匹配的玩家推进,但它只有在与超时值相关的一些不确定时间之后才会这样做。将超时值设置为 0 只会阻止游戏超过玩家 1。比赛数据正在更新,因此应用程序肯定正在与 Game Center 服务器进行通信。我在这里想念什么?
private void endTurn(double timeout)
{
// Copies list of participants to a mutable array
GKTurnBasedParticipant[] Participants = new GKTurnBasedParticipant[match.Participants.Length];
match.Participants.CopyTo(Participants, 0);
// Advances to the next player
match.EndTurn(Participants, timeout, matchData, (e) =>
{
// If there is an error message, print it to the console
if (e != null)
{
Console.WriteLine(e.LocalizedDescription);
Console.WriteLine(e.LocalizedFailureReason);
}
// Otherwise proceed normally
else
turnOverUpdate();
});
}