Expand description
Protocol types shared between the installer and the server.
Serde types only: no I/O, no async, no HTTP. Timestamps are unix seconds. Any change here is a protocol change and lands on both sides in one PR.
A package’s address is <data>/<game>/packages/<directory>/<name>.zip.
directory decides who may see it (PUBLIC_DIR is everyone’s), and
name is its path under that directory, which is also its place in the
installer’s tree: codriver/polish/male/Kamil is category codriver,
levels polish → male, leaf Kamil. Both stay lookup keys that are
never joined onto a filesystem path.
Modules§
- access 🔒
- api_
error 🔒 - category 🔒
- A category is the first segment of
PackageInfo::name: the folder a package sits in under its access directory. The set is open; these are the known ones. - conflict_
report 🔒 - download_
path 🔒 - game 🔒
- Game ids, as used in
installer/DESIGN.mdrev. 2 andinstaller/src/gamedir.rs. The set is open: a new game needs no protocol bump. - game_
schema 🔒 - key_
status 🔒 - lookup_
key 🔒 - manifest 🔒
- package 🔒
- package_
ref 🔒
Structs§
- ApiError
- The body of every non-2xx response.
- Conflict
- One file several packages wrote.
- Conflict
Report - The body of
POST /report/conflict: packages the user selected wrote the same file, and the later one won. - Game
Schema - A game’s install schema as the manifest publishes it: which categories its catalogue has, which ask for one pick, and where each installs.
- KeyStatus
- The body of
GET /whoamifor a live access key; every other key is a 401, so the status alone tells a mistyped key from a good one, which/packagescannot, since it falls back to the public listing. - Manifest
- The body of
GET /packages. - Package
Info - One installable package as listed by
GET /packages. - Package
Ref - A package’s
directory/name: its download path, its cache and ledger key, and the wire form of arequiresentry. - Schema
Category - One
[[category]]of a game’s schema.
Constants§
- AUTH_
HEADER - Carries the credential as
Authorization: Bearer <token>. - BEARER_
PREFIX - CATEGORY_
CODRIVER - CATEGORY_
LANGUAGE - CATEGORY_
PACENOTES - CATEGORY_
STYLE - CHOICE_
CATEGORIES - The categories the Configuration scene asks for exactly one pick from, in display order.
- GAME_
ASSETTOCORSA - GAME_
BEAMNG - GAME_
DIRT_ RALL Y2 - GAME_
RBR - INSTALL_
ROOT_ GAME SchemaCategory::install_root: the folder holding the game’s marker executable.- KNOWN_
CATEGORIES - Lets the server spot a category name filed where an access directory belongs.
- KNOWN_
GAMES - Lets the server spot a game id filed where something else belongs.
- PUBLIC_
DIR - The access directory every caller may list and download, with or without a token.
- SCHEMA_
FILE - A game’s schema file on the server,
<data>/<game>/schema.toml; the canonical copy is the repository’sschemas/<game>.toml. - SELECT_
ANY SchemaCategory::select: optional, installed as ticked.- SELECT_
ONE SchemaCategory::select: the user must pick exactly one.
Functions§
- category_
of_ download_ path - The first segment of the name in a
game/directory/name. - default_
game - The game of a package from a manifest written before games existed, which listed RBR only.
- split_
download_ path - Takes a
game/directory/nameapart, the inverse ofPackageInfo::download_path; only the first two/separate, since the name is itself a path.Noneunless every part is valid. - valid_
id - Is this a usable game id or access directory name:
[a-z0-9_-]+? - valid_
name - Is this a usable
PackageInfo::name:/-separated segments, none empty, none.or.., and no\or control character anywhere?