简体   繁体   English

Google Play游戏服务-管理成就

[英]Google Play Game Services - Managing achievements

According to the GPGS website- 根据GPGS网站-

Use the client libraries. 使用客户端库。 The mobile client libraries employ a number of strategies to reduce the calls you make to the service. 移动客户端库采用了许多策略来减少您对该服务的调用。 For instance, achievement and leaderboard data is cached, so a user can view their achievements as often as they'd like without requiring the service to make multiple calls. 例如,成就和排行榜数据被缓存,因此用户可以根据需要随时查看其成就,而无需该服务进行多次呼叫。 Both the Android and iOS client libraries will know not to send a player's score to the server if your score isn't as good as one you recently submitted. 如果您的分数不如您最近提交的分数,那么Android和iOS客户端库都不会将玩家的分数发送到服务器。 The Android library also automatically combines frequent achievement increment calls when it detects that you are being rate limited. 当检测到您受到速率限制时,Android库还会自动组合频繁的成就增量调用。

I'm specifically interested in 'viewing achievements without requiring the service to make multiple calls'. 我特别对“查看成就而不需要服务进行多次通话”感兴趣。 As far as I can see, the best way to do this would be to use the OnAchievementsLoadedListener and get a reference to the achievementBuffer. 据我所知,最好的方法是使用OnAchievementsLoadedListener并获取对achievementBuffer的引用。

Will that buffer be updated when an achievement state is changed and is it okay not to close that buffer immediately? 当成就状态更改时,该缓冲区会更新吗?可以立即关闭该缓冲区吗? If not, the OnAchievementsUpdatedListener does not pass a buffer or even and indiviudal achievement reference so how would I get the updated collection of achievements? 如果不是,则OnAchievementsUpdatedListener不会传递缓冲区,甚至不传递个别的成就引用,那么我将如何获取更新的成就集合?

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

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