玩游戏loadLeaderboardMetadata()返回过时的数据 [英] Play games loadLeaderboardMetadata() returns outdated data

查看:199
本文介绍了玩游戏loadLeaderboardMetadata()返回过时的数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩游戏服务的应用程序,我正在做一个自定义的用户界面,显示排行榜的名单,只有得分和玩家的排名为动态数据。

I'm working on an app with Play Game Services, and I'm making a custom UI to display the list of leaderboards with only the score and the ranking of the player as dynamic data.

然后,当用户点击分数或排名,他将采取排行榜默认的UI显示在细节这个特殊的排行榜。

Then, when the user clicks on the score or ranking, he will be taken to the leaderboard default UI to display this particular leaderboard in details.

在换句话说:我正在做一个自定义的用户界面leadeboards名单,但我用默认的用户界面来显示特定的排行榜

In other words: I'm making a custom UI for leadeboards list, but I use default UI for displaying a specific leaderboard.

我用loadLeaderboardMetadata()方法来获得排行榜的数据。问题是,它返回过时的数据,甚至当我使用loadLeaderboardMetadata(背景下,真正的)来强制数据的重新加载。

I use loadLeaderboardMetadata() method to get the leaderboards data. The problem is it returns outdated data, even when I use loadLeaderboardMetadata(context, true) to force the reloading of data.

此外,如果我点击一个过时的分数显示特定排行榜的默认用户界面,这里的数据是最新的! ......然后,如果我回到我的排行榜名单,并强制在装载数据,然后为这个特定的领先的数据将是最新的(而不是数据的其他排行榜)。

Moreover, if I click on an outdated score to display a specific leaderboard with the default UI, the data here is up to date ! ... and then, if I go back to my list of leaderboards and force the data reload, then the data for this specific leaderboard will be up to date (but not the data for other leaderboards).

任何想法和/或方法可以解决呢?

Any idea and/or ways to work around that?

感谢你在前进,

斯特凡。

推荐答案

我终于发现,通过使用替代loadLeaderboardMetadata方法loadCurrentPlayerLeaderboardScore,似乎工作。

I finally found that by using the loadCurrentPlayerLeaderboardScore instead of the loadLeaderboardMetadata method, it seems to work.

更新:除了这个方法实在是太慢了,如果你有30个排行榜,并引发错误,因为您对对API的调用得多,所以它不是一个可行的选择。除非你有非常少的排行榜。

Update: Except that this method is really slow if you have 30 leaderboards, and it throws error because you make to much call to the API's, so it is not a viable option. Except if you have very few leaderboards.

这篇关于玩游戏loadLeaderboardMetadata()返回过时的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆