question

nimgoble avatar image
nimgoble asked

UpdatePlayerData Returning Success But Not Committing Data

Hi. I'm using playfab with UE4. I'm trying to update a player's data from the server. I have the developer secret api key set and am calling the correct updateplayerdata node. This is what I'm sending as the data to UpdatePlayerData:

camp: {
                    BuildingObjects: [
                        {
                            ID: "Dummy_Foundation",
                            Durability: 200,
                            Floor: 1,
                            Transform:
                            {
                                Location: [ 45078.5234375, 75703.8046875, -1933.546142578125 ],
                                Rotation:
                                {
                                    "X": [ 0.64278686046600342, 0.76604509353637695, 0 ],
                                    "Y": [ -0.76604509353637695, 0.64278686046600342, -0 ],
                                    "Z": [ -0, 0, 1 ]
                                }
                            }
                        }
                    ]
                }

The call returns success, but when I go to look at the player's public data, there's nothing there. In fact, when I manually put something in the player's title data via the web interface and then make the above call, it clears out the player's title data.

Any idea why this is happening?

12 comments
10 |1200

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

Citrus Yan avatar image Citrus Yan commented ·

May I know which "player's public data" you were referring to? Could you please share the screenshot?

0 Likes 0 ·
nimgoble avatar image nimgoble commented ·

This is the player.

0 Likes 0 ·
nimgoble avatar image nimgoble commented ·

...There was supposed to be an image in there...

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan nimgoble commented ·

Please use this button to insert image:

0 Likes 0 ·
nimgoble avatar image nimgoble Citrus Yan commented ·

I mean... Do you want a screenshot of an empty public data?

0 Likes 0 ·
Show more comments
nimgoble avatar image nimgoble nimgoble commented ·

Title ID: B2523.

Yes, I was looking at the Player Data(Title) tab.

0 Likes 0 ·
nimgoble avatar image nimgoble commented ·

Test Person : 688302B369F9BC73

0 Likes 0 ·

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

OK, UpdateUserData takes a stringified & escaped JSON object as the value, more info, please see: https://community.playfab.com/questions/8740/updateuserdata-question-regarding-json-arrays.html.

Therefore, for your case, the request should be like this:

Request: {
    "Data":
    {
        "Camp": "{\"BuildingObjects\":[{\"ID\":\"Dummy_Foundation\",\"Durability\":200,\"Floor\":1,\"Transform\":{\"Location\":[44987.48046875,74542.5703125,-1799.57470703125],\"Rotation\":{\"X\":[1,0,0],\"Y\":[0,1,0],\"Z\":[0,0,1]}}}]}"
    },    
    "KeysToRemove": null,
    "Permission": "Public",
    "PlayFabId": "688302B369F9BC73"
}
2 comments
10 |1200

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

nimgoble avatar image nimgoble commented ·

That worked. Thank you.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan nimgoble commented ·

Glad it helped:)

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.