launcher: DORKNET_LOCAL_* env-var overrides for dev testing

Set DORKNET_LOCAL_MANIFEST and/or DORKNET_LOCAL_RELEASES to point
the launcher at on-disk artifacts instead of the public repo:

- DORKNET_LOCAL_MANIFEST: full path to a versions.json file.
  VersionsManifest.FetchAsync reads it from disk and skips the
  GitHub round-trip.
- DORKNET_LOCAL_RELEASES: path to a directory laid out as
  {root}/{version_key}/server/ + .../patcher/. EnsureServerAsync /
  EnsurePatcherAsync return those paths in-place — no download,
  no copy, no marker files.

Both are silent no-ops when unset / missing on disk, so it's safe
to leave them set permanently in a dev profile. When at least one
is active, the Settings view surfaces a "Dev overrides active"
panel listing the paths so it's obvious the launcher isn't using
the public manifest.

Lets contributors iterate on per-version branch changes against
the launcher UI without needing to tag a public Release.
This commit is contained in:
Alexa
2026-05-27 11:45:08 +03:00
parent 5452ff06ee
commit 7d1ac82cf8
5 changed files with 136 additions and 0 deletions
+10
View File
@@ -44,6 +44,11 @@ public sealed class ReleaseDownloader
IProgress<DownloadProgress>? progress,
CancellationToken ct = default)
{
// Dev-time override — use a local server build in-place rather
// than downloading from GitHub. Skips cache entirely.
var local = LocalOverrides.GetLocalServerDir(version.VersionKey);
if (local is not null) return local;
var dir = Path.Combine(AppPaths.ServersRoot, version.VersionKey);
var marker = Path.Combine(dir, ".dorknet-version");
// If the marker file exists, the server is already unpacked
@@ -73,6 +78,11 @@ public sealed class ReleaseDownloader
IProgress<DownloadProgress>? progress,
CancellationToken ct = default)
{
// Dev-time override — same as EnsureServerAsync but for the
// client-patcher dir.
var local = LocalOverrides.GetLocalPatcherDir(version.VersionKey);
if (local is not null) return local;
var dir = Path.Combine(AppPaths.PatchersRoot, version.VersionKey);
var marker = Path.Combine(dir, ".dorknet-version");
if (File.Exists(marker)) return dir;