feat(pipeline): WCMD chat slash command catalog (143rd open format)

Novel replacement for the implicit slash-command registry
vanilla WoW carried in the client's ChatFrame.lua + server-side
per-command CommandHandler hooks (no formal data-driven catalog;
commands were registered ad-hoc with hard-coded security checks
scattered across LevelMgr / WorldMgr / CharacterMgr). Each WCMD
entry binds one command name to its aliases, minimum security
level required, argument schema string, help text, per-player
throttle in ms, hidden flag (for debug-only commands), and
category.

Three presets covering the security-tier spectrum:
  --gen-cmd-basic     4 standard player Info commands (/who
                      /played /time /ginfo) at Player security
                      with no throttle
  --gen-cmd-movement  3 emote-style Movement commands (/sit
                      /stand /sleep) with short typing-speed
                      aliases ("sd" / "su" / "sd")
  --gen-cmd-admin     3 GameMaster-only Admin commands
                      (/announce 5s throttle / /kick 2s
                      throttle / /ban 10s throttle —
                      demonstrating per-command rate-limiting
                      to prevent admin-spam abuse)

Validator catches: id+command required, minSecurityLevel 0..4,
category 0..4, no duplicate cmdIds. CRITICAL: command names
AND aliases share one flat namespace (chat parser dispatches
uniformly by typed string) — duplicate name across canonical+
aliases errors. Warns on uppercase chars in names (parser is
case-insensitive but convention is lowercase), Admin-category
command at Player/Helper security level (likely security
misconfiguration — admin commands usually require GameMaster+),
throttleMs > 60000 (likely ms-vs-s units typo — 60+ second
throttle is nearly unusable), self-alias (canonical already
matches), and empty helpText (/help would show the command
without description).

Format count 142 -> 143. CLI flag count 1481 -> 1488.
This commit is contained in:
Kelsi 2026-05-10 05:47:23 -07:00
parent 2fa2eb9cf0
commit 5f5a696495
10 changed files with 795 additions and 0 deletions

View file

@ -2755,6 +2755,16 @@ void printUsage(const char* argv0) {
std::printf(" Export binary .wtur to a human-editable JSON sidecar (defaults to <base>.wtur.json; emits triggerEvent as int + name string; multibyte strings preserved)\n");
std::printf(" --import-wtur-json <json-path> [out-base]\n");
std::printf(" Import a .wtur.json sidecar back into binary .wtur (triggerEvent int OR \"login\"/\"zoneenter\"/\"levelup\"/\"itempickup\"/\"skilltrain\" — round-trips title/body/target text byte-identical)\n");
std::printf(" --gen-cmd-basic <wcmd-base> [name]\n");
std::printf(" Emit .wcmd 4 standard player Info commands (/who /played /time /ginfo) all at Player security level, no throttle\n");
std::printf(" --gen-cmd-movement <wcmd-base> [name]\n");
std::printf(" Emit .wcmd 3 emote-style Movement commands (/sit /stand /sleep) with short aliases\n");
std::printf(" --gen-cmd-admin <wcmd-base> [name]\n");
std::printf(" Emit .wcmd 3 GameMaster-only Admin commands (/announce 5s throttle / /kick 2s throttle / /ban 10s throttle) demonstrating per-command rate-limiting\n");
std::printf(" --info-wcmd <wcmd-base> [--json]\n");
std::printf(" Print WCMD entries (id / /command / minSecurityLevel / category / hidden / throttleMs / aliases count / argSchema)\n");
std::printf(" --validate-wcmd <wcmd-base> [--json]\n");
std::printf(" Static checks: id+command required, minSecurityLevel 0..4, category 0..4, no duplicate cmdIds; CRITICAL: command names + aliases share one flat namespace (chat parser dispatches uniformly) — duplicate name across canonical+aliases errors. Warns on uppercase chars (parser is case-insensitive but convention is canonical lowercase), Admin-category command at Player/Helper security (likely security misconfiguration), throttleMs > 60000 (likely ms-vs-s units typo), self-alias (canonical already matches), and empty helpText (/help would show no description)\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");