我在将分数数据发送到 iOS 游戏的游戏中心排行榜时遇到问题。我使用cocos2d引擎。
我按照苹果清单上的说明进行操作:
https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/LeaderBoards/LeaderBoards.html#//apple_ref/doc/uid/TP40008304-CH6-SW14
我检查了 BundleID,在 iTunesConnect 上设置了排行榜。
在应用程序启动时,我登录本地播放器。所以我可以在屏幕顶部看到“欢迎回来......”,它还表明我在沙盒中。
为了发送分数,我使用了 Apple 的最佳实践代码。当我调试代码时,我可以看到发送分数数据没有错误。我还多次检查了排行榜 ID 的拼写。
当我打开游戏中心应用程序或在应用程序中显示排行榜视图控制器时,我根本看不到任何分数。我还检查了我是否使用我的 Sandbox 帐户登录。
有什么建议吗?
安迪
I have problem to send my score data to the game center leaderboard on my iOS game. I use the cocos2d engine.
I followed the instruction on Apples checklist:
https://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/LeaderBoards/LeaderBoards.html#//apple_ref/doc/uid/TP40008304-CH6-SW14
I checked BundleIDs, set up the Leaderboards on iTunesConnect.
On the application startup I sign in the local player. So I can see on the top of the screen "Welcome back ..." and it also says that I'm in the Sandbox.
To send the score I use the best practice code from Apple. When I debug the code I can see that there is no error with sending the score data. I also checked several times the spelling of the Leaderboard ID.
When I open the game center app or I show the leaderboard view controller in my app, I don't see any scores at all. I also checked that I loged in with my Sandbox account.
Any suggestions?
Andy
发布评论
评论(3)
看来苹果的沙盒排行榜服务器有问题。无需对我的代码进行任何更改,一天后它就可以工作了。
It seems to be that the sandbox leaderboard server from Apple had have a problem. Without any changes on my code it worked one day later.
我遇到了同样的问题,我花了几个小时才发现我设置了错误的分数范围。请小心这一点,特别是当您存储浮点或十进制值而不是整数时。
例如,当您想要以固定点 - 到 3 位小数的格式存储分数时,在这种情况下
score = 1.234
将值存储到排行榜时,您已经将分数乘以 1000 以获得整数值:
因此,如果您计划存储值 1.234,则保存到排行榜的实际值应该是 1234。在这种情况下,如果您将分数范围设置为 0 到100,远大于 1.234,但不保存分数,因为 100 < 1234.
I faced with same issue and it took me some hours just to figure out that I was setting wrong score range. Please be careful about this, especially when you are storing float or decimal value not integer.
For example, when you want to store score with format Fixed point - to 3 Decimals,
score = 1.234
in this caseWhen storing value to leaderboard, you already multply the score by 1000 to have the integer value:
Hence, if you planed to store the value of 1.234, the real value saved to leaderboard should be 1234. In this case, if you set the score range from 0 to 100, much greater than 1.234, but the score is not saved because 100 < 1234.
用于计算最高分的 GKLeaderBoardViewController 类。有关更多详细信息,我建议您阅读下面的链接。谢谢
http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKLeaderboardViewController_Ref/Reference/Reference.html
GKLeaderBoardViewController class for counting Highest Score.For more details I suggested you to read below link.Thanks
http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKLeaderboardViewController_Ref/Reference/Reference.html