mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-11 19:43:52 +00:00
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.
This commit is contained in:
parent
5f5a696495
commit
7fbf35e98c
3 changed files with 191 additions and 0 deletions
|
|
@ -2765,6 +2765,10 @@ void printUsage(const char* argv0) {
|
|||
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(" --export-wcmd-json <wcmd-base> [out.json]\n");
|
||||
std::printf(" Export binary .wcmd to a human-editable JSON sidecar (defaults to <base>.wcmd.json; emits both minSecurityLevel and category as int + name string; aliases as JSON string array)\n");
|
||||
std::printf(" --import-wcmd-json <json-path> [out-base]\n");
|
||||
std::printf(" Import a .wcmd.json sidecar back into binary .wcmd (minSecurityLevel int OR \"player\"/\"helper\"/\"moderator\"/\"gamemaster\"/\"admin\"; category int OR \"info\"/\"movement\"/\"communication\"/\"admincmd\"/\"debug\"; aliases array preserved)\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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue