iOS 游戏中心:沙盒中的分数未显示在排行榜上

发布于 2024-12-23 18:55:31 字数 681 浏览 3 评论 0原文

我正在开发一款支持 Game Center 的游戏,但在沙盒环境中遇到了问题。我可以成功报分,没有错误。但是,当我显示排行榜时,看不到分数。为了验证分数是否确实到达那里,我使用以下代码查询本地用户的分数:

-(void)retrieveLocalScoreForCategory:(NSString *)category
{
    GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
    leaderboardRequest.category = category;

    [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores,NSError *error) 
     {
         [self callDelegateOnMainThread: @selector(localPlayerScore:error:) withArg: leaderboardRequest.localPlayerScore error: error];
     }];
}

在我的委托中,我将分数记录到控制台,我可以看到那里的正确分数。我已经验证我正在使用正确的排行榜类别 ID 显示排行榜(我只有一个)。

有谁知道为什么我的分数不能立即显示在沙盒环境中的排行榜上?分数显示之前是否有延迟?

I'm developing a Game Center enabled game and I'm running into an issue in the sandbox environment. I can successfully report the score without error. However, when I show the leaderboard, there are no scores visible. To verify that the score actually got there, I query the local user's score with the following code:

-(void)retrieveLocalScoreForCategory:(NSString *)category
{
    GKLeaderboard *leaderboardRequest = [[GKLeaderboard alloc] init];
    leaderboardRequest.category = category;

    [leaderboardRequest loadScoresWithCompletionHandler: ^(NSArray *scores,NSError *error) 
     {
         [self callDelegateOnMainThread: @selector(localPlayerScore:error:) withArg: leaderboardRequest.localPlayerScore error: error];
     }];
}

In my delegate I log the score to the console and I can see the correct score got there. I have already verified that I'm showing the leaderboard using the correct leaderboard category id (I only have one).

Does anyone know why my score isn't visible on the leaderboard in the sandbox environment immediately? Is there a delay before the score shows up?

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

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

发布评论

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

评论(2

<逆流佳人身旁 2024-12-30 18:55:31

我在从事的项目中遇到了同样的问题。

仅当排行榜上有两名或更多玩家时,GC 排行榜(沙盒/实时)才会返回分数。

因此,请确保您在一台设备上使用 2 个不同帐户提交分数,或者在不同设备上使用 2 个不同帐户提交分数。

I ran into the same issue with projects I've worked on.

The GC Leaderboards (Sandbox/live) will only return scores if there are two or more players on the Leaderboards.

So make sure you either submit the score with 2 different accounts on one 1 device or 2 different accounts on separate devices.

乖不如嘢 2024-12-30 18:55:31

尝试更改时间范围。

有时 GKLeaderboardTimeScopeAllTime 和GKLeaderboardTimeScopeToday 不返回任何内容,但 GKLeaderboardTimeScopeWeek 工作正常。我认为这是GC沙箱服务器的问题。

听听苹果公司的说法:利用这数十亿美元中的一部分来改善您的网络服务。

Try changing timeScope.

Sometimes GKLeaderboardTimeScopeAllTime & GKLeaderboardTimeScopeToday returns nothing but GKLeaderboardTimeScopeWeek works fine. I think it's a GC sandbox server problem.

Hear us Apple: use some of those billions to make your web services better.

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