Skip to main content

Module store

Module store 

Source
Expand description

The data root: package zips on disk, the generated manifest that lists them, and the message of the day.

data/rbr/packages/public/codriver/polish/male/Kamil.zip
     ^game        ^dir   ^------------ name -----^
data/motd/<lang>.txt
data/manifest.json

Modules§

derived_version 🔒
file_hash 🔒
game_schema 🔒
Each game’s <data>/<game>/schema.toml: which categories its catalogue has, published in the manifest with the hash installers compare.
generate 🔒
manifest gen: walk <data>/<game>/packages/<directory>/**/*.zip, hash every zip, merge its sidecar, and collect what the publisher should fix.
generated 🔒
manifest_file 🔒
manifest_store 🔒
motd 🔒
publish_guards 🔒
What publishing a new manifest would take away from the live one without anyone deciding it, which manifest gen refuses unless told otherwise.
requires_check 🔒
sidecar 🔒
sidecar_migration 🔒

Structs§

Generated
A generated manifest and what the publisher should look at, collected so the CLI prints them together and tests can assert on them.
ManifestStore
The published manifest, reloaded when manifest.json’s mtime changes.
Migration
What migrate_to_sidecars did.

Constants§

BUNDLED_SCHEMAS
The repository’s schemas/<game>.toml byte for byte, which installers of the same release embed too.
DERIVED_VERSION_PREFIX
Marks a version derived from a package’s bytes rather than written in a sidecar.
MANIFEST_FILE
MOTD_DIR
The folder beside the games holding <lang>.txt message-of-the-day texts.
MOTD_FALLBACK_LANG
PACKAGES_DIR
The folder under each game that manifest gen scans; anything else in a game folder is ignored.
REPORTS_DIR
Installers’ conflict reports, beside the games but not one.
RESERVED_TOP_LEVEL
Folders the server keeps beside the games, which manifest gen must not publish or warn about as games.

Functions§

derived_version
sha- + the first 8 hex chars of the sha256: the same on every rebuild and replica, and different for every payload, unlike the old fixed 0.0.0.
generate
A zip outside an access directory or with a broken sidecar is withheld as an error rather than published with silently wrong metadata; the rest publishes. A game publishes nothing without a valid schema.toml, and a package in a category its schema does not declare is skipped.
generate_with
generate, comparing each game’s schema with bundled instead of this release’s own, so tests’ fixture schemas need not match the repository’s.
is_chosen_version
A version a person chose, as opposed to the legacy default or a derived one.
metadata_losses
Values the current manifest carries that publishing next would drop, one line per package and field.
migrate_to_sidecars
manifest migrate-to-sidecars: appends each value the current manifest carries and its package’s sidecar lacks, so a pure regeneration keeps it.
parse_schema
Validates a schema and hashes its raw bytes, comments included, since that is the hash an installer compares.
read_manifest
Reads and validates manifest.json; a missing file is an empty manifest.
sha256_bytes
Lowercase hex sha256 of bytes already in memory.
sha256_file
Lowercase hex sha256 of a file’s contents, streamed rather than read whole.
unpublished_games
Games the current manifest serves that next would take off the server entirely because their schema is missing or broken, typically after an upgrade that did not copy schema.toml in; a game whose packages all left on purpose keeps its schema and is not listed.
valid_lang
[a-z]{2,8}: lang names a file no manifest lists, so this alphabet is what keeps it inside the motd folder.
write_manifest
Writes <data>/manifest.json through a temp file renamed over it in the same directory, so a crash or a full disk leaves the previous manifest whole and a reloading server never reads half a file.
zip_file
Where a listed package’s zip lives; None unless every key is valid, so a hand-edited manifest cannot name a path outside the data root.