Skip to content

7D2D 3.0 config: version-aware editor + one-click serverconfig migration#105

Merged
AdaInTheLab merged 1 commit into
mainfrom
feat/config-3.0-migration
Jun 17, 2026
Merged

7D2D 3.0 config: version-aware editor + one-click serverconfig migration#105
AdaInTheLab merged 1 commit into
mainfrom
feat/config-3.0-migration

Conversation

@AdaInTheLab

Copy link
Copy Markdown
Collaborator

What

Brings KitsuneCommand's config editor in line with 7 Days to Die 3.0 ("Dead Hot Summer"), which moved the world/gameplay sandbox settings out of serverconfig.xml into the in-game Sandbox (a single SandboxCode).

  • Detect 3.0GameSupportsSandboxCode() reflects EnumGamePrefs for the 3.0-only SandboxCode member (compiles against the 2.x reference assemblies, true at runtime on a 3.0 server).
  • Version-aware editor — adds the SandboxCode field and hides the 26 sandbox-governed fields on a 3.0 server. The governed set (SandboxGovernedKeys) is derived authoritatively from the game itself (EnumGamePrefs ∩ SandboxOptions), verified against the 3.0 build — not from patch notes.
  • One-click "Migrate to 3.0" (banner shown when a 3.0 server still has the old props): MigrateConfigTo30() comments out the sandbox-governed properties (preserved as comments, not deleted), ensures SandboxCode exists, leaves survivors + unmodeled props untouched, takes a timestamped backup first, is idempotent, and refreshes the sticky .bak so the pre-start restore keeps it.

API: GET /api/config now returns needsMigration; POST /api/config/migrate-3.0 runs it (refuses on a non-3.0 server).

Verification

  • C# builds clean (0 errors).
  • 13 ServerConfigService tests pass (3 new): neutralize-governed + add-SandboxCode + keep-survivors, idempotency, and needs-migration detection.
  • Frontend builds clean (vue-tsc --noEmit + vite build).

Scope note: two unrelated fixes that were sitting uncommitted in the tree (OwinStartup.cs Mono/Autofac async-dispose, WebServerHost.cs login username normalization) are intentionally left out of this PR — they deserve their own commits.

🤖 Generated with Claude Code

…migration

3.0 ("Dead Hot Summer") moved the world/gameplay sandbox settings out of
serverconfig.xml into the in-game Sandbox, governed by a single SandboxCode.

- Detect 3.0 via GameSupportsSandboxCode() (reflects EnumGamePrefs for the
  3.0-only SandboxCode member — compiles against 2.x refs, true at runtime on 3.0).
- Editor: a SandboxCode field, and it hides the 26 sandbox-governed fields on a
  3.0 server (SandboxGovernedKeys, derived from the game's own
  EnumGamePrefs ∩ SandboxOptions — not from patch notes).
- New: one-click "Migrate to 3.0" (banner when needed). MigrateConfigTo30()
  comments out the sandbox-governed props in serverconfig.xml (preserved, not
  deleted), ensures SandboxCode exists, keeps survivors + unmodeled props,
  takes a timestamped backup first, is idempotent, and refreshes the sticky .bak.
  Gated on a real 3.0 install; pure file work so it stays unit-testable.

API: GET /api/config now returns needsMigration; POST /api/config/migrate-3.0
runs the migration (refuses on a non-3.0 server).

Verified: C# builds clean; 13 ServerConfigService tests pass (3 new — neutralize
+ SandboxCode, idempotency, needs-migration detection); frontend (vue-tsc + vite)
builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 35 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
frontend/src/views/ConfigEditorView.vue 0.00% 33 Missing ⚠️
frontend/src/api/config.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AdaInTheLab AdaInTheLab merged commit 6ba4ae1 into main Jun 17, 2026
2 of 3 checks passed
@AdaInTheLab AdaInTheLab deleted the feat/config-3.0-migration branch June 17, 2026 07:19
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