Define the packets for the chat command list

Adds the two message definitions which let a client ask for the chat
commands of its player and receive them in a machine readable form:

- ChatCommandListRequest (C1, F5/00), sent by the client after it
  entered the game world.
- ChatCommandInfo (C2, F5/01), one message per available command. It
  carries the command, its localized name and description, the required
  character status and one entry per parameter with its name, short
  name, kind and accepted values.

F5 is unused in both directions and in the client, and F3 - the other
candidate - is character scoped, so it doesn't fit.

The generated code was produced with the same transformations the
project uses, so the diff only adds the new types and leaves the
existing ones untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MSpK6jkyF8ZS5nYXyGwYxA
(cherry picked from commit 2cd46516f6136cfc7f96f4d3b7db4c8329559d3a)
This commit is contained in:
Claude
2026-07-25 21:11:29 +00:00
committed by Acentech Dev
parent 960664c1c3
commit 4f83b72de8
2 changed files with 142 additions and 1 deletions

View File

@@ -4268,6 +4268,18 @@
</Field>
</Fields>
</Packet>
<Packet>
<HeaderType>C1HeaderWithSubCode</HeaderType>
<Code>F5</Code>
<SubCode>00</SubCode>
<Name>ChatCommandListRequest</Name>
<Caption>Request chat command list</Caption>
<Length>4</Length>
<Direction>ClientToServer</Direction>
<SentWhen>A client which supports a user interface for chat commands requests the list of commands which are available to the player. It's usually sent after the character entered the game world.</SentWhen>
<CausedReaction>The server sends a ChatCommandInfo for each available chat command.</CausedReaction>
<Fields />
</Packet>
</Packets>
<Enums>
<Enum>

View File

@@ -11240,6 +11240,135 @@
</Structure>
</Structures>
</Packet>
<Packet>
<HeaderType>C2HeaderWithSubCode</HeaderType>
<Code>F5</Code>
<SubCode>01</SubCode>
<Name>ChatCommandInfo</Name>
<Direction>ServerToClient</Direction>
<SentWhen>After the client requested the list of available chat commands. One message is sent for each command which is available to the player.</SentWhen>
<CausedReaction>The client adds the command to its list of known commands, so that it can offer them to the player without requiring him to know or type them.</CausedReaction>
<Fields>
<Field>
<Index>5</Index>
<Type>Byte</Type>
<Name>Index</Name>
<Description>The index of this command within the list, starting at 0.</Description>
</Field>
<Field>
<Index>6</Index>
<Type>Byte</Type>
<Name>Count</Name>
<Description>The total number of commands which are available to the player, so that the client knows when it received all of them.</Description>
</Field>
<Field>
<Index>7</Index>
<Type>Enum</Type>
<TypeName>CharacterStatus</TypeName>
<Name>MinimumCharacterStatus</Name>
<Description>The character status which is required to execute the command.</Description>
</Field>
<Field>
<Index>8</Index>
<Type>Byte</Type>
<Name>ParameterCount</Name>
</Field>
<Field>
<Index>9</Index>
<Type>String</Type>
<Name>Command</Name>
<Length>32</Length>
<Description>The command including its slash, e.g. '/item'.</Description>
</Field>
<Field>
<Index>41</Index>
<Type>String</Type>
<Name>Name</Name>
<Length>48</Length>
<Description>The name of the command, in the language of the player.</Description>
</Field>
<Field>
<Index>89</Index>
<Type>String</Type>
<Name>Description</Name>
<Length>256</Length>
<Description>The description of the command, in the language of the player.</Description>
</Field>
<Field>
<Index>345</Index>
<Type>Structure[]</Type>
<TypeName>ChatCommandParameter</TypeName>
<Name>Parameters</Name>
<ItemCountField>ParameterCount</ItemCountField>
<Description>The parameters of the command, in the order in which they are expected when they are entered without their short names.</Description>
</Field>
</Fields>
<Structures>
<Structure>
<Name>ChatCommandParameter</Name>
<Description>Describes one parameter of a chat command, so that a user interface can offer an input for it.</Description>
<Length>102</Length>
<Fields>
<Field>
<Index>0</Index>
<Type>Boolean</Type>
<Name>IsRequired</Name>
<Description>Defines if the parameter has to be specified to execute the command.</Description>
</Field>
<Field>
<Index>1</Index>
<Type>Enum</Type>
<TypeName>ChatCommandParameterType</TypeName>
<Name>Type</Name>
<Description>The kind of value which is expected, so that a fitting input can be shown.</Description>
</Field>
<Field>
<Index>2</Index>
<Type>String</Type>
<Name>Name</Name>
<Length>32</Length>
</Field>
<Field>
<Index>34</Index>
<Type>String</Type>
<Name>ShortName</Name>
<Length>20</Length>
<Description>The short name which is used in the 'shortName=value' notation. It's empty when the parameter can only be passed by its position.</Description>
</Field>
<Field>
<Index>54</Index>
<Type>String</Type>
<Name>ValidValues</Name>
<Length>48</Length>
<Description>The accepted values, separated by a pipe. It's empty when the parameter isn't limited to a set of values.</Description>
</Field>
</Fields>
</Structure>
</Structures>
<Enums>
<Enum>
<Name>ChatCommandParameterType</Name>
<Description>The kind of value which a chat command parameter expects.</Description>
<Values>
<EnumValue>
<Name>Text</Name>
<Description>The parameter expects a text.</Description>
<Value>0</Value>
</EnumValue>
<EnumValue>
<Name>Number</Name>
<Description>The parameter expects a number.</Description>
<Value>1</Value>
</EnumValue>
<EnumValue>
<Name>Boolean</Name>
<Description>The parameter expects a 0 or a 1.</Description>
<Value>2</Value>
</EnumValue>
</Values>
</Enum>
</Enums>
</Packet>
</Packets>
<Enums>
<Enum>