CloudStore¶
System · CloudStore · server and client scripts
CloudStore saves player data in the cloud, where every server of the place can read it. Use Store when the data stays on one server machine.
Methods on a CloudStore or SortedCloudStore handle yield until the request completes and return a StoreStatus first. Each server has these limits:
- Reads and writes each have a budget of 60 requests a minute plus 10 for each player in the place.
Updatespends one read and one write, plus more on each version-conflict retry. - At most 30 requests can wait for the cloud backend at once.
- A value is at most 262144 bytes; a larger value returns
"TooLarge"without sending a request. - A key has 1 to 128 bytes and no control characters.
- A store
namehas 1 to 50 letters, digits,'_', or'-', and a place opens at most 16 stores.
Open¶
Open opens the key-value store name and returns its CloudStore handle. Opening the same name again returns the same store.
Example
Errors (1)
| Error | When |
|---|---|
Open can only be called from the server |
Called from a client script. |
OpenSorted¶
OpenSorted opens the leaderboard store name and returns its SortedCloudStore handle. A sorted store maps each key to a whole-number score and reads keys sorted by score; opening the same name again returns the same store.
Effects
Setreturns"KeyLimit"when the store already has 4,096 keys and"QuotaFull"when the place's storage quota is full.- A local test server keeps scores in memory, so they are gone when it stops.
Example
Errors (1)
| Error | When |
|---|---|
OpenSorted can only be called from the server |
Called from a client script. |