leaderboarScore.getRawScore()工作正常,但getRank()总是返回LEADERBOARD_RANK_UNKNOWN

时间:2017-09-08 11:38:30

标签: google-play-services

我正在尝试显示没有标准用户界面的玩家的当前得分和排名。问题是等级总是-1。我已经显示了标准的排行榜UI,我的位置是“1”(我是唯一的玩家xD)。我无法想象出了什么问题。这是我的代码。

Games.Leaderboards.loadCurrentPlayerLeaderboardScore(mGoogleApiClient, getString(R.string.leaderboard_global),
                LeaderboardVariant.TIME_SPAN_ALL_TIME, LeaderboardVariant.COLLECTION_PUBLIC).setResultCallback(new ResultCallback<Leaderboards.LoadPlayerScoreResult>() {
            @Override
            public void onResult(final Leaderboards.LoadPlayerScoreResult scoreResult) {
                if(scoreResult != null && scoreResult.getStatus().isSuccess()) {
                    mGeneralScore = scoreResult.getScore();
                    mGeneralScore.getRawScore();//return the score
                    mGeneralScore.getRank();//return -1
                    mGeneralScore.getDisplayRank();//return "unknow" 
                }
            }
        });

0 个答案:

没有答案