Skip to content

📦 Snapshots

Save and restore inventory and equipment state using a JSON-based API.


🎯 Purpose

Provide a simple persistence mechanism for capturing and restoring runtime inventory state.


🧩 What Lives Here

  • InventorySnapshots → capture, save, load, and apply inventory state

⚠️ Important Notes

  • Snapshots operate on runtime containers, not authoring data
  • They do not enforce authority or networking behaviour
  • They do not resize containers

🧠 Usage Guidance

Capture

Captures current inventory (and optionally equipment) state as JSON.


Save / Load

Provides helpers to persist JSON to disk and retrieve it later.


Apply

Applies snapshot data to live containers.

  • inventory is cleared and repopulated
  • equipment is cleared and repopulated when provided
  • requires an item database for GUID resolution

Behaviour notes

  • only up to container capacity is applied
  • extra entries may be ignored
  • equipment slots contain a single item
  • container events may be coalesced during apply

Missing items

Handling is controlled via snapshot options.

  • unknown items may be skipped
  • or replaced with a placeholder when configured

Container size

Snapshots respect current container size and do not modify it.


🚫 Not for Production Use

This folder does not:

  • Provide authoritative state synchronization
  • Handle multiplayer replication
  • Perform validation logic
  • Guarantee compatibility across snapshot versions