Skip to main content

Module made

Module made 

Source
Expand description

What made a record or a save: the engine’s version, the game’s word for its build, and a fingerprint of the content it ran on (Made). A record played back by another build can play differently without a bug in either; its stamp tells that apart from a desync.

A game stamps its own save or record with a made: Made field, filled by Made::new when it is written (the fingerprint is the shipped bundle’s, shuyi_assets::bundle::Bundle::fingerprint, computed once and kept). After reading one back it calls Made::check with this build’s stamp: what to do with a Mismatch is the game’s (play on, warn, refuse). A field #[serde(default)] of Option<Made> keeps older files without one readable.

The engine’s version (ENGINE_VERSION) moves only at a release. A game pinned to a git revision of the engine that wants that revision in its stamp puts it in the game’s word ("my-game 1.2.0 engine 3f2a1c9").

Structs§

ContentHash
A fingerprint of a game’s content: the same bytes give the same one on every platform. Shown, and written to a file, as sixteen lowercase hex digits, as a StateHash is shown (a string, since JSON can’t hold every u64).
Differs
One part that differs between two stamps.
Made
What made a record or a save: the engine, the game’s build and the content it ran on, as the module docs say.
Mismatch
How a stamp differs from this build’s (Made::check): each part that differs, in the order engine, game, content. Shown as made with engine 0.1.0, content 1a2b3c4d5e6f7a8b; this build: engine 0.2.0, content 3c4d5e6f7a8b9c0d.
NotAHash
Text that isn’t a ContentHash: sixteen hex digits.

Enums§

Part
A part of a Made.

Constants§

ENGINE_VERSION
The engine’s version: every shuyi-* crate has the workspace’s.