playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 965 forks source link

Social.LoadUsers returns stale data #2994

Closed MrKsiJ closed 3 years ago

MrKsiJ commented 3 years ago

Greetings! Faced with such a problem, I wanted to make a dynamic update of user data, so that you can see how the avarts and nicknames are updated if the user changed them, but the Social method.LoadUsers for some reason returns outdated data about users, but if I change my nickname and profile picture, then for some reason my data is updated quickly through this method. What could be the problem?

internal void GetGooglePlayUsersData()
    {
        string[] UsersID = new string[UserList.Count];
        List<RofltemCard> ListRofltemCards = roflList.GetCurrentRoflList();
        for (int i = 0; i < UsersID.Length; i++)
            UsersID[i] = UserList[i].DataBaseUserID;

        Social.LoadUsers(UsersID, callback => 
        {
            if (callback != null)
            {
                roflUsersGooglePlayData = callback;
                StartCoroutine(UpdateIconUserInPage());
                GetNickNameGeneratePageUser();
                user.RefreshUserData();
                foreach (RofltemCard rl in ListRofltemCards)
                    rl.ReloaderUserNameAndIconUser();
                TimerUpdateLoadUsers = 15f;
            }
        });
    }
MrKsiJ commented 3 years ago

That no one has ever encountered such a problem? Then explain to me why the fuck did you add this method?

MrKsiJ commented 3 years ago

Well at least explain how it works where it knocks where it gets data how it does it? Maybe I just need to change the token in the console from local to global?

MrKsiJ commented 3 years ago

Anyway, the people solved the problem themselves, I just get a local user and update it in the database and then others see the database update download the data and thus all the dynamic ones are updated. And the Social method.LoadUsers galimoe shit that urgently needs to fix! And forgive me for being so abrupt, I just spent the whole day trying to solve this problem and because of this I was very burned out!!!