Skip to content

feat: apply the registry status in the window and quarantine the mod loader when suspended - #65

Merged
fogrew merged 8 commits into
release/3.0.0from
feature/server-gate-quarantine
Oct 27, 2026
Merged

fogrew merged 8 commits into
release/3.0.0from
feature/server-gate-quarantine

Conversation

@fogrew

@fogrew fogrew commented Oct 27, 2026

Copy link
Copy Markdown
Member

Closes #59. Part of #7.

What changes

The window asks the registry before every update and launch (ServerAccess over the existing ServerGate and ServerPolicy, which are unchanged):

Status In the window
approved Update and launch as before. A quarantined mod loader entry point is restored first.
needs-approval, installed Warning dialog. "Start anyway" restores the entry point and starts the game from the installed files, with no check or update. A check or update request only gets a notice that updates are paused. Not listed and not addable when not installed.
suspended The launch and the update are refused, the entry point is disabled, the dialog explains why and asks whether to remove the files (the full folder path is shown). Not installed: a plain notice.
Missing from the index, or index not loadable Installed: starts from the installed files, no update. Not installed: cannot be added.
Built-in profile Ignores the registry; no index is fetched.

A fresh index is also applied at startup to every installed profile it suspends, not only the one on screen (folders under clients/<id> and those set in config.ini).

Quarantine

ProfileQuarantine (Launcher.Core): winhttp.dll on Windows, start_game_bepinex.sh / run_bepinex.sh on macOS and Linux, renamed to <name>.suspended, only in a profile folder that holds the game executable. Injector mode (game from Steam or a game folder of its own) has nothing to disable and is left untouched.

quarantine.json is written atomically before the rename and removed after the restore. Both halves are idempotent, so every interrupted state converges on the next run: recorded but not renamed, renamed with the record kept, restored with the record kept. Only the known entry point names are ever restored from the record, so an edited record cannot rename other files.

Removal

ProfileRemoval goes through LauncherPaths.CanUse (writable, empty or already a client). It also refuses a drive root and any folder that is, or contains, the launcher's own folder, the game folder or the Steam install.

Tests

  • Launcher.Tests: 301 -> 381. New: ProfileQuarantineTests, ServerAccessTests (every status, installed or not, playing or not; status flips; replayed index; startup sweep), ProfileRemovalTests, InstalledLaunchTests, plus path, guard and localisation cases. READMEs updated.
  • Launcher.Avalonia.Tests: 10 -> 17. ServerStatusDialogTests drives the real dialogs headless (suspended keep and remove, not installed, needs-approval cancel and paused notice, approved, built-in). New README for the project.
  • Not covered by any test: the game actually starting after "Start anyway" or for an unlisted profile, and anything visual.

Notes

  • Launcher.Cli and the legacy WPF Launcher only ever use the built-in profile (ServerProfile.Default), and the CLI never starts the game (startGame: false), so there is no gate to apply there.
  • Strings are English and Russian; other languages fall back to English.
  • MainWindow: the launch code in OnUpdateComplete and the Steam lookup in StartUpdateAsync are extracted into TryLaunchGame and FindSteamGameFolder so the launch-from-installed-files path reuses them; behaviour of the update path is unchanged.
  • docs/registry-trust-policy.md names the exact entry point files and describes the window behaviour.

Open questions

  1. A suspended installed profile is not listed in the picker, so the refusal and removal dialogs are reachable only when the window is already on that profile (the cached index said something else at startup). Otherwise the player gets the entry point disabled silently and no offer to remove the files. A startup notice or an "installed but suspended" row would close that; it is a layout decision.
  2. Launching from the installed files in Steam injector mode does not re-verify the Steam build against the server (the update path does). Same for the unlisted and unreachable-registry cases.
  3. ServerPolicy ignores RegistryLoadResult.Source, so an index served from the cache (still unexpired) allows updates. Left as is, since ServerPolicy was not to be redesigned.

🤖 Generated with Claude Code

fogrew and others added 8 commits October 27, 2026 12:35
Rename winhttp.dll (Windows) or the BepInEx start script (macOS, Linux) of a
profile folder that holds a game copy to <name>.suspended, recording it in
quarantine.json before the rename and restoring it from that record. Profile
folders without a game copy (injector mode) are left untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ServerAccess asks the registry before an update or launch and plans the next
step for approved, needs-approval, suspended, unlisted and unreachable
profiles, disabling the mod loader entry point while a profile is suspended
and restoring it before a launch the status allows. A fresh index also
disables every installed suspended profile, not only the one in view.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ating

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The window asks the registry before an update or launch. Approved goes on as
before; needs-approval warns first, pauses updates and starts from the
installed files only after a yes; suspended refuses, explains and offers to
remove the files; an unlisted profile or an unreachable registry starts from
the installed files without updating, and cannot be added when not installed.
A fresh index at startup also disables every installed suspended profile.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rantine

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@fogrew
fogrew force-pushed the feature/server-gate-quarantine branch from e0b244e to 68312ca Compare October 27, 2026 10:35
@fogrew
fogrew merged commit 4277d85 into release/3.0.0 Oct 27, 2026
2 checks passed
@fogrew
fogrew deleted the feature/server-gate-quarantine branch October 27, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant