从所有 google 排行榜中获取用户分数

Get user scores from all google leaderboards

我有一个多级别的游戏,我为每个级别设置了一个排行榜,现在我想获得一个用户在所有级别的得分。

我可以使用 get API of google 服务获得一个级别的分数,但我在使用多个排行榜时遇到问题。

我尝试用 for 循环来做到这一点,但我遇到了 "Rate Limit Exceeded" 问题(这似乎是由于 for 循环正在发送多个快速请求)。

如何获得所有分数?

Ps: 我试过setTimeout,总是遇到同样的问题(有时它会检索数据但通常不会)。

关于 Rate Limit Exceeded 错误,基于此 documentation, you will see errors in your callback handlers or listeners when your game exceeds its rate limit. To request for additional quota for your application, click the Request more link next to your app's quota entry in the Google API Console. Please be aware, however, that requests for additional games quota probably will not be honored unless your game is experiencing truly exceptional usage and is obeying these best practices

此外,此 related SO post is to look at keeping a database of scores yourself, vs. using leaderboards as a datastore. Something like Firebase Realtime Database 中的建议操作可能更合适。