7D2D 3.0 config: version-aware editor + one-click serverconfig migration#105
Merged
Conversation
…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 Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.xmlinto the in-game Sandbox (a singleSandboxCode).GameSupportsSandboxCode()reflectsEnumGamePrefsfor the 3.0-onlySandboxCodemember (compiles against the 2.x reference assemblies, true at runtime on a 3.0 server).SandboxCodefield 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.MigrateConfigTo30()comments out the sandbox-governed properties (preserved as comments, not deleted), ensuresSandboxCodeexists, leaves survivors + unmodeled props untouched, takes a timestamped backup first, is idempotent, and refreshes the sticky.bakso the pre-start restore keeps it.API:
GET /api/confignow returnsneedsMigration;POST /api/config/migrate-3.0runs it (refuses on a non-3.0 server).Verification
ServerConfigServicetests pass (3 new): neutralize-governed + add-SandboxCode + keep-survivors, idempotency, and needs-migration detection.vue-tsc --noEmit+vite build).🤖 Generated with Claude Code