question

bbekec avatar image
bbekec asked

About user data system

Hello, I am using Playfab in my card game.

I want to keep players scores in Playfab permanently. In each time player win, i want to change the new value with the old one.

Currently, i can successfully upload scores to the leaderboard, but i am resetting this daily. beside the leaderboard, i need to keep the scores as a data for each player and i will get them for each player from Playfab.

I made a research and found that i can do this by Player Data system. But unfortunately i couldn't understand the structure and how to manage it. I am using Playfab Unity SDK, and i made an API call by using "UpdateUserDataRequest " as you can see below;

Dictionary<string, string> _data = new Dictionary<string, string>();
        _data.Add("PermanentGeneralScoreOnline", PlayerPrefs.GetInt("GeneralScore").ToString());
        var req = new UpdateUserDataRequest() { Data = _data,  };
        PlayFabClientAPI.UpdateUserData(req, 
            (success) => 
            {
                Debug.Log("Success");
            }, 
            (error) => 
            {
                Debug.LogError("Fail");
            });

This worked for me to create a new key, but not for value. Value stayed zero.

Can you pls make a simple explanation for me.

Thanks,

data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
bbekec avatar image
bbekec answered

I'm so sorry, that was my problem. I found the problem.

I mistakenly get the wrong PlayerPref data by script.

Thanks

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.