Zone Data
Each zone in a GameServerProxy can have its own persistent data that's not shared with other zones in the proxy (unlike World Data, which every zone shares). It's stored per proxy and zone, and loaded whenever a server for that zone starts.
For example, zone data could track which of a zone's bosses have been defeated, or the state of a zone-specific event.
Unreal Setup
Zone Data works just like World Data, with a different reserved ID:
- Make sure the Asset Manager scans
RedwoodSyncItemAssetand that you have aRedwoodSyncItemAssetData Asset whose Actor Class is your Game State class (the same one you'd create for World Data). - Add a Redwood Sync Component (
URedwoodSyncComponent) to yourAGameStateclass. - Set its Redwood Id to
zone. - Enable its Persist Changes (
bPersistChanges). - Add a struct variable for the zone data (with an integer
SchemaVersionfield) and set the component's Data Variable Name to that variable's name.
Your Game State can have both a proxy Sync Component (World Data) and a zone Sync Component (Zone Data); just give them different Data Variable Names (e.g. WorldData and ZoneData).
To save changes to the struct, call Mark Data Dirty (MarkDataDirty()) on the zone Sync Component on the server. Zone Data is saved at the DatabasePersistenceInterval along with the rest of the zone's persistent data.
Zone Data is saved and loaded correctly, but live updates aren't applied to the zone's other shards while they're running; each shard only picks up the latest saved Zone Data when it starts. If several shards of a zone need to see changes immediately, use World Data or a Sync Item instead.