question

brendan avatar image
brendan asked

What kind of data can I store in Player Data?

Question from a developer:

What kind of data can I store on the "Value" of the Player Data?

Can I store:

1. An array on the "VALUE" of a single "KEY" . For example: (x, y) coordinate of an object?
2. A data stream on the "VALUE" of a single "KEY". For example: 2.2, 2.1, 0.8, 1.3, 44, ABS, 0.1, 2.3. .............. etc ?

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

·
brendan avatar image
brendan answered

Player data is stored as arbitrary string/string key/value pairs. So,

1. Yes. Ex (just the value - assume the key is something like "foo"):

"1, 2, 3, 4, 5" or "[1, 2, 3, 4, 5]" or "{ \"MyArray\": \"[1, 2, 3, 4, 5]\" }", etc.

2. If you literally mean a stream, where you open it, write to it periodically, and eventually flush/close it, then no. Writing to player data is via a Web API call, not a socket operation. So you could write a stream of data by writing the current complete stream, then later writing to the same key with the updated complete stream (or you could read it, append the new data, then write it).

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.