Commit graph

2 commits

Author SHA1 Message Date
Kelsi
7fbf35e98c feat(editor): WCMD JSON round-trip closure
Adds --export-wcmd-json / --import-wcmd-json with the established
readEnumField template factoring int+name dual encoding for both
minSecurityLevel ("player"/"helper"/"moderator"/"gamemaster"/
"admin") and category ("info"/"movement"/"communication"/
"admincmd"/"debug"). Aliases array serialized as JSON string
array.

All 3 presets (basic/movement/admin) byte-identical binary
roundtrip OK including the movement preset's multi-alias
commands (/stand has aliases ["standup", "su"]).

Live-tested flat-namespace collision validator: hand-mutated
/stand (cmdId=11) to add 'sit' as an alias, colliding with the
canonical /sit command. Validator correctly errored: "alias
'sit' collides with another command name or alias — chat
parser would dispatch ambiguously". Catches the class of typo
bugs where a new alias would shadow an existing command, with
the failure surface being silent dispatch ambiguity rather
than an error.

CLI flag count 1488 -> 1490.
2026-05-10 05:49:45 -07:00
Kelsi
5f5a696495 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.
2026-05-10 05:47:23 -07:00