feat(editor): add WCFG (Server Config) — 120th open format

Novel replacement for the worldserver.conf / mangosd.conf
flat-text configuration files vanilla server forks
shipped. Each entry binds one configId to its
polymorphic value via the valueKind enum (Float / Int /
Bool / String) — only the matching value field is
authoritative per entry.

The polymorphic value is the novel data shape: each
entry stores ALL three value carriers on disk
(floatValue float / intValue int64 / strValue string),
and valueKind picks which is meaningful at runtime. Bool
folds into intValue with strict 0/1 semantics. JSON
export reflects this: an activeValue derived field
renders the right form per kind so operators editing
JSON see only the relevant value.

Nine configKind values cover the full server-tunable
surface: XPRate / DropRate / HonorRate / RestedXP /
RealmType / WorldFlag / Performance / Security / Misc.
Each kind groups settings the server iterates by kind
at startup (all XPRate entries seed the per-class
experience matrix; all Security entries configure the
anti-cheat thresholds).

Three preset emitters: makeRates (4 vanilla baseline
rate multipliers with valueKind=Float), makePerformance
(4 server tuning configs mixing Int and Float kinds —
max creatures per cell, view distance yards, GC
interval seconds, etc.), makeSecurity (4 anti-cheat
configs FIRST format using valueKind=String for the
cheat-detection sensitivity preset name).

Validator's most novel checks are per-valueKind cross-
field consistency: Bool requires intValue strictly 0/1
(error), and warns on cross-field bleed (Float kind
with non-zero intValue means the int is silently
ignored at runtime but persists on disk). Plus name
uniqueness — server name-based config lookups would
be ambiguous otherwise.

Format count 119 -> 120 (multiple-of-10 milestone).
CLI flag count 1262 -> 1267.
This commit is contained in:
Kelsi 2026-05-10 02:57:26 -07:00
parent 9a734acb87
commit 441ca0d139
10 changed files with 761 additions and 0 deletions

View file

@ -2433,6 +2433,16 @@ void printUsage(const char* argv0) {
std::printf(" Export binary .wskp to a human-editable JSON sidecar (defaults to <base>.wskp.json; emits cloudSpeedX10 as both raw int AND derived cloudSpeedMph float convenience field)\n");
std::printf(" --import-wskp-json <json-path> [out-base]\n");
std::printf(" Import a .wskp.json sidecar back into binary .wskp (no enum coercion — all-numeric payload; cloudSpeedX10 raw int OR cloudSpeedMph float — converts mph * 10 -> raw with rounding and clamp to 0..255)\n");
std::printf(" --gen-cfg <wcfg-base> [name]\n");
std::printf(" Emit .wcfg 4 rate-multiplier configs (XPRate 1.0x / DropRate 1.0x / HonorRate 1.0x / RestedRate 200%%) — vanilla baselines\n");
std::printf(" --gen-cfg-perf <wcfg-base> [name]\n");
std::printf(" Emit .wcfg 4 server tuning configs (max creatures per cell 100 / view distance 533 yards / spawn rate 1.0x / GC interval 300s)\n");
std::printf(" --gen-cfg-sec <wcfg-base> [name]\n");
std::printf(" Emit .wcfg 4 anti-cheat configs (speedhack tolerance 1.05x / trade gold cap 100,000g / GM audit logging enabled / cheat-detection \"high\" preset — first format using valueKind=String)\n");
std::printf(" --info-wcfg <wcfg-base> [--json]\n");
std::printf(" Print WCFG entries (id / configKind / valueKind / restart-required / active value rendered per kind / name)\n");
std::printf(" --validate-wcfg <wcfg-base> [--json]\n");
std::printf(" Static checks: id+name required, configKind 0..7 OR 255 Misc, valueKind 0..3, no duplicate configIds OR config names (server name-based lookups would be ambiguous), Bool valueKind requires intValue 0/1; warns on cross-field bleed (Float kind with non-zero intValue, etc.)\n");
std::printf(" --catalog-pluck <wXXX-file> <id> [--json]\n");
std::printf(" Extract one entry by id from any registered catalog format. Auto-detects magic, dispatches to the per-format --info-* handler internally, then prints just the matching entry. Primary-key field is auto-detected (first *Id field, or first numeric)\n");
std::printf(" --catalog-find <directory> <id> [--magic <WXXX>] [--json]\n");