feat(editor): add WSCB JSON round-trip (--export/--import-wscb-json)

Dual encoding for both channelKind (int 0..4 OR
"login"/"system"/"raidwarning"/"motd"/"helptip") and
factionFilter (int 1..3 OR "alliance"/"horde"/"both") on
import. Export emits both int and *Name string fields
for round-trip safety; the int form is authoritative,
the *Name string is for human edit ergonomics and is
ignored if the int form is also present.

All 3 presets (motd/maintenance/helptips) byte-identical
roundtrip OK. Token-form import smoke-tested with mixed
channel+faction tokens. CLI flag count 1109 -> 1111.
This commit is contained in:
Kelsi 2026-05-10 00:33:38 -07:00
parent 57df129404
commit 8c0cab27be
3 changed files with 186 additions and 0 deletions

View file

@ -2135,6 +2135,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WSCB entries (id / channel / faction / interval / level range / name)\n");
std::printf(" --validate-wscb <wscb-base> [--json]\n");
std::printf(" Static checks: id+name+messageText required, factionFilter 1..3, channelKind 0..4, min<=max level, no duplicate ids, intervalSeconds>=10 (errors below); warns on interval>0 with login/MOTD (timer ignored), interval<60 (spammy), text>255 chars (truncation)\n");
std::printf(" --export-wscb-json <wscb-base> [out.json]\n");
std::printf(" Export binary .wscb to a human-editable JSON sidecar (defaults to <base>.wscb.json; emits both channelKind/factionFilter ints AND name strings)\n");
std::printf(" --import-wscb-json <json-path> [out-base]\n");
std::printf(" Import a .wscb.json sidecar back into binary .wscb (channelKind int OR \"login\"/\"system\"/\"raidwarning\"/\"motd\"/\"helptip\"; factionFilter int OR \"alliance\"/\"horde\"/\"both\")\n");
std::printf(" --gen-weather-temperate <wow-base> [zoneName]\n");
std::printf(" Emit .wow weather schedule: clear-dominant + occasional rain + fog (forest / grassland)\n");
std::printf(" --gen-weather-arctic <wow-base> [zoneName]\n");