游戏中心:排行榜检索分数
我正在开发一个游戏中心应用程序。我的排行榜之一显示了玩家获得的总分。我通过检索存储在排行榜中的玩家的当前分数并添加最后收到的分数来做到这一点。
问题似乎是接收到的值有点过时了。如果您提交分数,您最多需要 1 小时才能收到此数字,但提交的分数会立即显示在排行榜中。
这种延迟与沙盒环境有关还是一个必须处理的普遍问题?
提前致谢
I am developing an Game Center application. One of my leaderboards presents the total score earned by the player. I'm doing this by retrieving the current score of the player stored in the leaderboard and adding the last received score.
The problem seems to be that the values one receive are a little bit outdated. If you submit a score it takes up to 1 hour till you receive this number, though the submitted score shows up in the leader board immediately.
Is this kind of delay related to the sandbox environment or is it a general problem one has to deal with?
Thank in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的经验,游戏中心服务器的更新时间差异很大,尽管我无法与生产服务器(仅限沙箱)交谈。
如果您正在为排行榜制作自己的 UI(而不是使用 Game Center 的 ViewController),我建议您在设备上以变量的形式跟踪用户的总得分,并在每次用户获得更多分数时更新 Game Center 排行榜点。每次启动应用程序时,您都可以使用排行榜上用户的 GKScore 来初始化总得分变量。
In my experience, the Game Center servers' update time varies significantly, although I can't speak to the production servers (only sandbox).
If you are making your own UI for the leaderboard (as opposed to using Game Center's ViewControllers), I would recommend keeping track of the users' Total Score on the device in a variable and simply updating the Game Center leaderboard each time the user gets more points. Each time the app launches, you initialize the Total Score variable with whatever the user's GKScore is on the leaderboard.