Search Unity

[Unity GPGS] Can I get the score reflected on the leaderboard in Realtime?

Discussion in 'Android' started by dbsckdqja75, Feb 7, 2020.

  1. dbsckdqja75

    dbsckdqja75

    Joined:
    Jan 16, 2018
    Posts:
    3
    Hi everyone, I faced a problem as I worked on the game that was released on Google Play Store.



    I want to do the following:

    1. After the network game is over, online scores are reflected on the GPGS Leaderboard.

    2. The corresponding online score may be less than or more than the last score reflected.
    (If the new score is less than the one reflected, the lower score should be reflected on the leaderboard.)

    3. Every time the game app runs, it calls up the score that it last reflected.




    Issues and Questions:

    1. If the score already reflected on the leaderboard is higher than the new score, the new score will not be reflected.
    (I wanted a new score to be reflected each time I called ReportScore() regardless of the low or high score.)

    2. Previously, the leaderboard synchronization was very fast, but now it seems to be a 24-hour synchronization structure.

    3. Because of the first Issues, the following occurs:
    After playing a network game, if your existing online score has been reduced, if you re-run the game app, it will be called back to the highest score reflected on the leaderboard and returned.
    (All I wanted was the reduced score to be reflected on the leaderboard and the reduced score to be re-recalled.)




    How can I solve this Issues?.. ㅠㅠ

    [LoadScore Code]
    Code (CSharp):
    1. public void LoadOnlineScore()
    2.     {
    3.         if (isAuthenticated)
    4.         {
    5.             PlayGamesPlatform.Instance.LoadScores(GPGSIds.leaderboard_world_ranking_online_score, LeaderboardStart.PlayerCentered, 1, LeaderboardCollection.Public, LeaderboardTimeSpan.AllTime,
    6.                 (LeaderboardScoreData data) =>
    7.                 {
    8.                     if (data.PlayerScore.value >= 0)
    9.                     {
    10.                         DataManager.SaveData("OnlineScore_Data", (int)data.PlayerScore.value);
    11.                     }
    12.                 });
    13.         }
    14.         else
    15.             Login();
    16.     }

    [ReportScore Code]
    Code (CSharp):
    1. public static void ReportOnlineScore()
    2.     {
    3.         Social.ReportScore(DataManager.LoadData("OnlineScore_Data"), GPGSIds.leaderboard_world_ranking_online_score, (bool reportSuccess) =>
    4.         {
    5.             if (reportSuccess)
    6.                 Debug.Log("Success");
    7.             else
    8.                 Debug.Log("Failure");
    9.         });
    10.     }