有什么方法可以以编程方式重置排行榜?

发布于 2024-12-02 14:46:19 字数 231 浏览 2 评论 0原文

当我查看 GKScore 和 GKLeaderboard 的文档时,无法将玩家报告的分数重置到 GameCenter 中的特定排行榜。我说得对吗?

这看起来很不一致,因为可以重置成就:

[GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) { ... }];

有什么想法吗?

As I look into documentation of GKScore and GKLeaderboard, there is no way to reset scores reported by player to particular leaderboard in GameCenter. Am I right?

This seems quite inconsistent, since it is possible to reset achievements:

[GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) { ... }];

Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼前雾蒙蒙 2024-12-09 14:46:19

你是对的。一旦游戏中心排行榜类别在实时应用程序中启动,就无法重置该类别或删除该类别。

苹果确实允许重置成就的方法。

据我所知,唯一的解决方法是让旧类别消失,将它们置于底部,将与该类别关联的标签更改为“高分(已存档)”之类的内容,然后创建一个新类别并为其添加标签“高分”并将其排序到顶部。这会给你带来新鲜感。但当然,排行榜类别仍然有 25 个限制 - 因此,在某些时候,除非您弄清楚如何重用旧类别,否则您会陷入困境。 (例如,将所有分数设为 x10,以便每个人都能很快超越旧分数)

编辑...在最近的版本中,我实际上在最近的应用程序更新中重复使用了排行榜类别。该类别最初的用途是用于相当低的分数……在 1000 分以下。该类别的新用途将是该类别的 10 倍到 1000 倍。所以我知道该类别中的任何旧分数都会在游戏的前几次游戏中被删除。当然,类别 ID 不能更改(com.company.app.category),但描述(英语或其他形式)可以更改。它可能会变得令人困惑,因为在为完全不同的事物保存分数时,您使用的类别具有一个事物的 id。但是,通过 #define kBlahBlahBlah to @"com.company.app.blah",您的代码可以使用任何名称,以便轻松保持正常。希望有帮助。

You are correct. There is no way to reset a Game Center leaderboard category or to remove a category once it's been launched in a live app.

Apple did allow a way to reset an achievement.

The only work around that I know of is to just allow old categories to die, resort them to the bottom, change the label associated with the category to be something like "High Score (Archived)" and then create a new one and label it "High Score" and sort it to the top. This will give you a fresh one. But of course there is still a limit of 25 leaderboard categories - so at some point you're sunk unless you just figure out how to reuse old ones. (For example, make all your scores x10 so that everyone rises up above the old scores very quickly)

EDIT... In a recent version I actually did reuse a leaderboard category in a recent app update. The original use of the category was for scores that were fairly low... in the low 1000's. The new use of the category was going to be anywhere from 10x to 1000x that. So I knew that any old scores in that category would be erased within the first couple plays of the game. OF course the category id can't change (com.company.app.category), but the description (english or otherwise) can change. It can become confusing because you're using a category that has an id of one thing when saving scores for something totally different. But with #define kBlahBlahBlah to @"com.company.app.blah" you're code can use whatever name makes it easy to keep things straight. Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文