简体   繁体   English

iOS游戏中心排行榜假数据

[英]iOS game center leaderboard fake data

I am implementing game center leaderboard to my game and would like to use the leaderboard data to influence the gameplay. 我正在游戏中实现游戏中心排行榜,并希望使用排行榜数据来影响游戏玩法。

My question is how to add fake data with different playerID into my sandbox game center so that I can test my feature. 我的问题是如何将具有不同玩家ID的虚假数据添加到我的沙盒游戏中心,以便我可以测试功能。

I tried run the game both on simulator and device with different sandbox game center account, but I don't understand why, they can only see "ME" in the leaderboard, not as expected seeing two different players. 我尝试在具有不同沙盒游戏中心帐户的模拟器和设备上运行游戏,但是我不明白为什么,他们只能在排行榜中看到“ ME”,而不能看到两个不同的玩家。

Then I tried switch different game center accounts on the same device, but same problem, there is only "ME" on the leaderboard. 然后,我尝试在同一台设备上切换不同的游戏中心帐户,但存在相同的问题,排行榜上只有“ ME”。

I have been googling this issue for a while but cannot find anything related. 我已经搜索了一段时间,但找不到任何相关内容。

To clarify my purpose again at the end, I just want to find an easy way to add fake data in my sandbox leaderboard so that I can test my feature, pretty much it. 最后,为了再次说明我的目的,我只想找到一种在沙箱排行榜中添加虚假数据的简便方法,以便我可以测试功能。 :P :P

Thanks for helping out! 感谢您的帮助! :D :D

I don't believe it's possible to do that. 我不认为有可能这样做。 What you can do is put fake data into your app. 可以做的就是将虚假数据放入您的应用程序。 Define a protocol that lets you get players and their scores (or positions in the leaderboard, if that's what you need). 定义一个协议,使您可以获取球员及其得分(如果需要,可以在排行榜中排名)。 For testing, supply a class that conforms to the protocol, that uses test data. 为了进行测试,请提供符合协议的使用测试数据的类。 In the wild, switch this for a class that gets its data from Game Center. 在野外,将其切换为从Game Center获取其数据的类。

Game Center seems quite flaky when it comes to running on a device and on the simulator - when testing challenges they very rarely get through between the two. 当在设备和模拟器上运行时,Game Center似乎很不稳定-测试挑战时,它们很少在两者之间通过。 It's also not very good at recognising user changes on the same device. 在同一设备上识别用户更改也不是很好。 From my tests it seems much more reliable if you have two or more actual devices running the game when testing Game Center features. 根据我的测试,在测试Game Center功能时,如果有两个或多个实际设备在运行游戏,则似乎更加可靠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM