Report saves
Three calls: start once, then report every load and save, and every removal.
The three calls
| Call | When |
|---|---|
Atomo.start(options) | Once, on the server, before players join. |
Atomo.report(store, key, data, info) | After every load and every save that worked, also of a player who is offline. |
Atomo.removed(store, key, info) | After a key is removed. |
None of them errors, waits or gives anything back, whatever it is given. start takes the options; the other two:
- storestringRequired
The data store’s name, as connected in Atomo, such as
"PlayerData".- keystringRequired
The data store key, such as
"Player_48213".- dataanyRequired
What was loaded or saved: the table your data store call gave back. Not used by
removed.- infoDataStoreKeyInfoRequired
The key info that came back with it. Atomo takes the save’s version, its time and its user IDs from it.
removedalso takesnil.
When to report
- After every load, before your game fills anything in, so Atomo has what was saved and not your defaults.
- After every save that worked, with what the save call gave back.
- Everywhere your game saves: admin commands, gifts to offline players, cleanup scripts. A save that isn’t reported reaches Atomo only when that player next loads, or with a full sync.
local ok, saved, info = pcall(function()
return store:UpdateAsync(key, transform)
end)
if ok then
Atomo.report("PlayerData", key, saved, info)
end
Without key info, nothing is sent
A report with no info is taken as a new player’s, whose first save is still to come: nothing is sent. That is the case for GetAsync on a key that has never been saved, and for every SetAsync, which gives back no key info. Save with UpdateAsync instead, or those saves reach Atomo only through a full sync.
Removing a key
local ok, _, info = pcall(function()
return store:RemoveAsync(key)
end)
if ok then
Atomo.removed("PlayerData", key, info)
end
Without key info (ProfileStore gives none), pass nil: the removal is dated when you call it. The record is marked Removed in Roblox and deleted from Atomo 30 days later, unless the key is saved again. See Removed keys.
What a report costs
report copies the data at once, so your game may change its table straight after, and returns. Copying is given about 4 ms of each frame, across all reports; a report past that is left out, and the player’s next load or save is reported as usual. Sending happens later, in the background.
- At most 12 requests a minute from each server, usually one every 7.5 seconds, with up to 50 saves in each.
- A newer save of a key that is still waiting replaces the older one: only the newest is sent.
- Saves larger than
maxSize(1 MB unless you set it) aren’t reported. Saves over 500 KB are reported at most once in about 5 minutes for each player.
All the numbers: Safety and limits.
Several data stores
One Atomo.start serves them all: report each with its own name. Each must be connected in Atomo, as its own data store of the game; the saves of one that isn’t are dropped, and the module says Atomo: a data store isn’t connected. Its saves aren’t reported. A server reports to 10 data stores at most.
Saves that change outside the game
A change made in the Creator Hub’s data store manager, an Open Cloud script or another tool reaches Atomo when that player next loads, or with a full sync, unless that tool reports it too.