Files
lanspread/crates/lanspread-peer-cli
ddidderr 62ceb063ac feat(peer): remove downloaded game files safely
Downloaded but uninstalled games can still occupy significant disk space. Add a
separate removal path for that state instead of overloading uninstall, which is
reserved for deleting only `local/` installs.

The peer runtime now exposes `RemoveDownloadedGame` with matching lifecycle
and active-operation events. The filesystem delete is intentionally strict: the
id must be a catalog game and a single path component, the target must be a
direct child of the configured game directory, the root must not be a symlink,
it must have a regular root-level `version.ini`, and it must not contain
`local/`, `.local.installing/`, or `.local.backup/`. Only then do we recursively
remove the game root.

The Tauri bridge exposes this as `remove_downloaded_game`, the frontend shows a
matching danger action only for downloaded-but-uninstalled games, and a
confirmation dialog warns that re-downloading can take a long time.

Test Plan:
- git diff --check
- just fmt
- RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= just test
- RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= just clippy
- RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= just build

Refs: user redesign nitpick about removing downloaded uninstalled games
2026-05-19 21:00:44 +02:00
..

lanspread-peer-cli

Scriptable peer harness for automated LAN-spread tests. The binary starts the core peer runtime without the Tauri GUI, reads one JSON command per stdin line, and writes JSONL events, results, and errors to stdout.

Running

just peer-cli-build
just peer-cli-image
just peer-cli-run alpha

Useful flags:

  • --games-dir PATH stores local archives and installs.
  • --state-dir PATH stores the generated peer identity.
  • --fixture GAME_ID seeds a tiny archive that the fixture unpacker can install.

Fixture Game Directories

fixtures/fixture-alpha, fixtures/fixture-bravo, and fixtures/fixture-charlie are ready-to-use game directories for local CLI smoke tests. Point --games-dir at one of them to start a peer with several catalog-backed fake games. Each game includes version.ini and a real RAR archive renamed to .eti; fixture-alpha and fixture-bravo share ggoo, while fixture-bravo and fixture-charlie share cnc4.

Commands

Every command is a JSON object with cmd or command; id is optional and is echoed back on the result or error line.

{"id":"s1","cmd":"status"}
{"id":"p1","cmd":"wait-peers","count":1,"timeout_ms":5000}
{"id":"c1","cmd":"connect","addr":"127.0.0.1:34567"}
{"id":"g1","cmd":"list-games"}
{"id":"d1","cmd":"download","game_id":"fixture-one","install":true}
{"id":"i1","cmd":"install","game_id":"fixture-one"}
{"id":"u1","cmd":"uninstall","game_id":"fixture-one"}
{"id":"q1","cmd":"shutdown"}