question

Falcon Land avatar image
Falcon Land asked

Acceptable Keys in UpdateUserData? Undocumented change?

Hi there,
I'm working on a game using PlayFab.

Everything worked fine as long as to 12.11.2015.
13.11.2015 I did not work, so I do not know.
And 14.11.2015 all went wrong with my game.

Many of my PlayFabClientAPI.UpdateUserData() calls return Success as always however they do NOT update the value on server.
I ignored it for a week or so, hoping it will go away the same way it came in - with NO change on my side. But it did not.

I dived into it now and I found out that it is probably the naming of my Keys which causes the troubles.
I use key names like these:
Skorepina.LoggedDeviceID
Achievement.DaysPlayed.currTier

It seems that it is the dot "." in the name that PlayFab suddenly does not like? After removing those dots, it works fine.
I did not find any documentation on what the key names actually may be except this:
https://api.playfab.com/Documentation/Client/method/UpdateUserData
where it only says: Note that keys are trimmed of whitespace, are limited in size, and may not begin with a '!' character.

1) Can you confirm that you made some changes about these? (It was sometime between 12.11.2015-14.11.2015)
2) What are the rules for the Keys?

Thanks for answer

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

·
brendan avatar image
brendan answered

The rules for keys are those you've stated (trimmed of whitespace, etc.). The fact that our JSON parser was causing an issue with a Key with a period in it was just reported the other day, and we have a bug open to address this issue. In the short term, the way to workaround this would be to remove the periods from the Key names. One approach to this, which would also be an optimization to the format described, would be to serialize the data as a JSON structure in the Key like so (in many JSON serialization libraries, this is normally how a complex object would be serialized in the toString call):

"Skorepina": "{ \"LoggedDeviceID\": \"some_value\" }",
"Achievement": "{ \"DaysPlayed\": \"{ \"currTier\": \"some_value\" }\" }"

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.