question

Pavlos Mavris avatar image
Pavlos Mavris asked

My dictionary values get reset in player data

Hi everyone,

Currently I'm using PlayFab for saving my player's progress and I'm facing an issue with the "PlayerData (Title)".

I'm saving in a .JSON format some data for game's world environment and I'm using a dictionary to save some extra data like if the game object is active or not. I'm using a string as a key and a boolean value true/false.

When the game saves the current state everything is uploaded fine and the JSON file has everything correct, but when I close the game and open it back again for some reason the dictionary it gets reset basically is empty and I'm not sure why this keeps happening and also everything also are okay inside the JSON.

Has anyone had any similar issue before or knows anything about it?

Thank you in advance.

Player 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

·
Rick Chen avatar image
Rick Chen answered

I cannot reproduce this issue. Generally, the player data won’t reset by itself. Please check the following conditions to troubleshoot:

  • If your client code has updated the player data to empty JSON to overwrite previous progress.
  • If you have a Scheduled Task/Rule that sets the player data to empty JSON.
1 comment
10 |1200

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

Pavlos Mavris avatar image Pavlos Mavris commented ·

Thank you for the answer, I've managed to find where was the issue. The issue was at the JSON deserialization. Basically I was using the "JsonUtility.FromJson()" method to deserialize it but I've replaced it with "JsonConvert.DeserializeObject<>()" method and it works fine.

0 Likes 0 ·

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.