Add explicit client/server side field to manifest #2

Merged
Matt merged 2 commits from feature/side-field into main 2026-05-22 15:15:03 +00:00
Owner

Bake each file's side (client/server/both) into manifest.json at build time. Replaces launcher's previous 'download everything' default and lets the server short-circuit its runtime Modrinth lookup when a file has an authoritative tag. Includes Bootstrap-Sides.ps1 (one-off populator), lockfile bumped to 0.10.0 with 3 client-only + 5 server-only + 25 both. Also makes Build-Pack.ps1 and Deploy-Brass.ps1 cross-platform (csproj fallback, rsync alternative to robocopy). Already deployed live on glados (manifest at https://bns.sijbers.uk/pack/manifest.json, server binary atomic-swapped + restarted, 0 mod-set drift).

Bake each file's side (client/server/both) into manifest.json at build time. Replaces launcher's previous 'download everything' default and lets the server short-circuit its runtime Modrinth lookup when a file has an authoritative tag. Includes Bootstrap-Sides.ps1 (one-off populator), lockfile bumped to 0.10.0 with 3 client-only + 5 server-only + 25 both. Also makes Build-Pack.ps1 and Deploy-Brass.ps1 cross-platform (csproj <Version> fallback, rsync alternative to robocopy). Already deployed live on glados (manifest at https://bns.sijbers.uk/pack/manifest.json, server binary atomic-swapped + restarted, 0 mod-set drift).
Matt added 2 commits 2026-05-22 15:14:45 +00:00
Bake each file's "side" (client / server / both) into manifest.json at
build time so both the launcher and the server filter deterministically
and offline. This replaces the launcher's previous "download everything"
default and lets the server short-circuit its runtime Modrinth lookup
when a file already has an authoritative tag.

Schema:
- ManifestFile.Side: "client" | "server" | "both" (null = "both" for
  backward compat with manifests pre-dating this field)
- Files marked "both" omit the field entirely to keep the JSON tight

Code changes:
- launcher Manifest.cs + ManifestSyncService: filter out "server" files
  in both the prune+download path and FindMissingFiles
- server Manifest.cs + ManifestSync: drop "client" files outright; only
  fall back to the existing runtime Modrinth lookup for files with no
  explicit side (legacy/un-tagged mods stay protected)
- server LockedMod: side field propagates into manifest at build time
- scripts/Build-Pack.ps1: propagate side from lockfile to manifest
- scripts/Bootstrap-Sides.ps1: one-off populator; queries Modrinth's
  client_side/server_side per project, conservatively marks restricted
  only when one side is "unsupported", leaves ambiguous cases as "both"
- pack/pack.lock.json: bootstrap-populated sides (3 client, 5 server,
  rest both); CurseForge mods default to "both" pending manual review;
  version bumped 0.9.3 -> 0.10.0 since clients must re-sync

Compatibility:
- Old launcher + new manifest: ignores unknown "side", downloads all
- New launcher + old manifest: side null -> "both", installs all
- Old server + new manifest: same -- runtime Modrinth lookup still works
- New server + old manifest: side null -> runtime lookup, same behaviour
Two small fixes that surface when running the deploy pipeline on a
non-Windows host (we now do this on glados via the Telegram bridge):

- Build-Pack.ps1: fall back to launcher/ModpackLauncher.csproj <Version>
  when Get-Item.VersionInfo.FileVersion returns empty. Linux PowerShell
  can't parse PE FileVersion from a Windows .exe, so the previous code
  threw "set <Version> in ModpackLauncher.csproj and republish" -- but
  the csproj <Version> *was* set, just not readable from a foreign PE.
  Appends ".0" so the embedded value still matches the 4-part form the
  Windows compile bakes in.

- Deploy-Brass.ps1: prefer rsync where available, fall back to robocopy
  otherwise. robocopy is Windows-only and bails on Linux/macOS hosts.
Matt merged commit 839d93f242 into main 2026-05-22 15:15:03 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: minecraft/brass-and-sigil#2