Skip to content

fix(ux): /help string drift — 9 commands had wrong syntax or wrong gate#291

Merged
CoreyRDean merged 2 commits into
developfrom
fix/help-string-drift
May 26, 2026
Merged

fix(ux): /help string drift — 9 commands had wrong syntax or wrong gate#291
CoreyRDean merged 2 commits into
developfrom
fix/help-string-drift

Conversation

@CoreyRDean
Copy link
Copy Markdown
Collaborator

Summary

Audit of SendChatHelp + SendChatHelpDetail (ServerNet.bb:31-109) against the actual Case dispatch in UpdateNetwork found 9 in-game help strings that misdescribed their command. Players running /help <cmd> would learn the wrong syntax, type something the parser silently rejects, and lose several seconds figuring out what's wrong.

The recon trigger was PR #290's reviewer, who spotted that /script <name>[,<params>] was actually /script <name>,<func> (handler splits to Name + Func and ignores any 3rd arg). That fix went in last PR; this PR is the comprehensive sweep of every remaining drift.

Defects fixed

Command Old help What handler actually does New help
/warp <area>[,<x>,<y>,<z>] (non-DM Info category) DM-gated; 2nd arg is Instance, not coordinates; warps to area's first PortalName$[i] <area>[,<instance>] -- warp self to area's first portal (moved to DM-only)
/warpother <player>,<area>[,<x>,<y>,<z>] Same — 3rd arg is Instance, not coords <player>,<area>[,<instance>] -- warp another player
/yell "shout to your entire area" Walks FirstOnlinePlayer engine-wide chain (:408-414) "shout to every online player on the server"
/xp <player>,<amount> GiveXP(AI, Int(Params$)) — single arg, self (:335) <amount> -- grant XP to self
/gold <player>,<amount> AI\Gold = AI\Gold + Int(Params$) (:340) <amount> -- adjust own gold (negative to deduct)
/setattribute <player>,<attr>,<value> 2-arg comma split; targets AI (:354) <attr>,<value> -- set own attribute
/setattributemax <player>,<attr>,<value> Same shape <attr>,<value> -- set own max attribute
/ability <player>,<ability> Name,Level 2-arg; AddSpell(AI, ...) (:577-580) <ability>,<level> -- grant own ability at level
/give <player>,<item>[,<amount>] Upper$(Params$) whole-string item-name match; assigns to AI (:588-602) <item> -- spawn item into own inventory
/gm "broadcast as GM to all players" Walks FirstOnlinePlayer but re-checks A2\Account.IsDM (:422-427) — DM-to-DM only "broadcast as GM to all DMs"

/warp also moved out of the non-DM Info summary line into the DM-only summary line, since its handler at :531 requires Account\IsDM.

Block comment added

Above the DM-only If block in SendChatHelpDetail, a comment now records the self-target invariant for future contributors:

All grant commands target self — the handlers in this file uniformly call GiveXP/AddSpell/etc. on AI, never on a Params-named player. /warpother is the sole exception that takes a target.

This keeps the next reviewer from re-introducing the <player>,... mistake when they add a new DM command.

Doc follow-up

Two stale entries in docs/protocol/packets/P_ChatMessage.md (the catalogue I just merged in #290) had the same <x>,<z> mistake copied from the broken help text. Corrected.

Test plan

  • compile.bat -t clean (Server + Client + GUE + Project Manager)
  • All 9 help strings cross-checked against their Case handler at the line range cited in the table above
  • Doc catalogue (docs/protocol/packets/P_ChatMessage.md) updated for /warp and /warpother
  • CI green

🤖 Generated with Claude Code

Audit of SendChatHelp + SendChatHelpDetail (ServerNet.bb:31-109) against
the actual Case dispatch in UpdateNetwork found 9 in-game help strings
that misdescribed the command. Players seeing /help would learn the
wrong syntax, type something the parser silently rejects, and lose
several seconds trying to figure out what's wrong.

Defects fixed:

  /warp -- moved from non-DM "Info" line to DM-only line (gate at
  ServerNet.bb:531 requires Account\IsDM). Syntax was "<area>[,<x>,<y>,
  <z>]" implying coordinates; handler at :534 reads Split$(Params$, 2,
  ",") as Instance (area-instance number), then walks PortalName$[i] for
  the first defined portal. There is no x/y/z plumbing on this path.
  New: "/warp <area>[,<instance>] -- warp self to area's first portal".

  /warpother -- same syntax fix ("<instance>" not "<x>,<y>,<z>").

  /yell -- description said "shout to your entire area" but the handler
  at :408-414 walks the FirstOnlinePlayer engine-wide chain. New:
  "shout to every online player on the server".

  /xp, /gold, /setattribute, /setattributemax -- help advertised a
  "<player>" first arg but every handler calls Give*/UpdateAttribute*
  on AI (self). The "<player>" slot was never read.

  /ability -- help said "<player>,<ability>" but handler at :577 splits
  into Name + Level and calls AddSpell(AI, ...). Actual syntax is
  "<ability>,<level>" granting to self.

  /give -- help said "<player>,<item>[,<amount>]" but handler at :588
  takes Upper$(Params$) and matches the whole string against an item
  Name. There is no <player> arg, no <amount> arg, the item goes to AI.
  New: "/give <item> -- spawn item into own inventory".

  /gm -- help said "broadcast as GM to all players" but the handler at
  :422-427 only sends to other DMs (re-checks A2\Account.IsDM). Tightened
  to "broadcast as GM to all DMs".

Block-comment added above the DM-only `If` documenting the self-target
invariant for future contributors: "All grant commands target self --
the handlers in this file uniformly call GiveXP/AddSpell/etc. on AI,
never on a Params-named player. /warpother is the sole exception."

Also corrected /warp and /warpother entries in
docs/protocol/packets/P_ChatMessage.md (catalogue I just merged in #290
had the same `<x>,<z>` mistake, copied from the broken help text).

Compile-verified clean across Server/Client/GUE/Project Manager.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CoreyRDean CoreyRDean requested a review from a team as a code owner May 26, 2026 17:24
Reviewer caught that the block comment added in the previous commit was
factually wrong: I wrote "/warpother is the sole exception that takes a
target," but /kick at ServerNet.bb:201-215 also takes a <player> arg
via FindActorInstanceFromName(Params$) and kicks that other player.

Updated comment to list both exceptions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@CoreyRDean CoreyRDean merged commit d86e05e into develop May 26, 2026
1 check passed
@CoreyRDean CoreyRDean deleted the fix/help-string-drift branch May 26, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant