Regenerate packet code from merged XML (TvT + chat-command packets)

The ClientToServer/ServerToClient packet .cs/.md are XSL-generated from the .xml
(Network.Packets PreBuild). Regenerated after hand-merging the packet XML so the
generated structs contain BOTH the AdaMu custom TvT (HeykelSavasi FA/FB/FC/FD +
TeamSelect) packets AND the upstream chat-command packets (F5/00 request, F5/01
AvailableChatCommand).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Acentech Dev
2026-07-27 01:19:53 +03:00
parent 4f63b5f4f3
commit 30b0fd1bc9
6 changed files with 610 additions and 1 deletions

View File

@@ -17604,6 +17604,83 @@ public readonly struct HeykelSavasiTeamSelect
/// <returns>The packet as byte span.</returns>
public static implicit operator Memory<byte>(HeykelSavasiTeamSelect packet) => packet._data;
}
/// <summary>
/// Is sent by the client when: 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.
/// Causes reaction on server side: The server sends an AvailableChatCommand message for each available chat command.
/// </summary>
public readonly struct ChatCommandListRequest
{
private readonly Memory<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="ChatCommandListRequest"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public ChatCommandListRequest(Memory<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ChatCommandListRequest"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
/// <param name="initialize">If set to <c>true</c>, the header data is automatically initialized and written to the underlying span.</param>
private ChatCommandListRequest(Memory<byte> data, bool initialize)
{
this._data = data;
if (initialize)
{
var header = this.Header;
header.Type = HeaderType;
header.Code = Code;
header.Length = (byte)Math.Min(data.Length, Length);
header.SubCode = SubCode;
}
}
/// <summary>
/// Gets the header type of this data packet.
/// </summary>
public static byte HeaderType => 0xC1;
/// <summary>
/// Gets the operation code of this data packet.
/// </summary>
public static byte Code => 0xF5;
/// <summary>
/// Gets the operation sub-code of this data packet.
/// The <see cref="Code" /> is used as a grouping key.
/// </summary>
public static byte SubCode => 0x00;
/// <summary>
/// Gets the initial length of this data packet. When the size is dynamic, this value may be bigger than actually needed.
/// </summary>
public static int Length => 4;
/// <summary>
/// Gets the header of this packet.
/// </summary>
public C1HeaderWithSubCode Header => new (this._data);
/// <summary>
/// Performs an implicit conversion from a Memory of bytes to a <see cref="ChatCommandListRequest"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator ChatCommandListRequest(Memory<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="ChatCommandListRequest"/> to a Memory of bytes.
/// </summary>
/// <param name="packet">The packet as struct.</param>
/// <returns>The packet as byte span.</returns>
public static implicit operator Memory<byte>(ChatCommandListRequest packet) => packet._data;
}
/// <summary>
/// The state of the trade button.
/// </summary>

View File

@@ -17397,3 +17397,80 @@ public readonly ref struct HeykelSavasiTeamSelectRef
/// <returns>The packet as byte span.</returns>
public static implicit operator Span<byte>(HeykelSavasiTeamSelectRef packet) => packet._data;
}
/// <summary>
/// Is sent by the client when: 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.
/// Causes reaction on server side: The server sends an AvailableChatCommand message for each available chat command.
/// </summary>
public readonly ref struct ChatCommandListRequestRef
{
private readonly Span<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="ChatCommandListRequestRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public ChatCommandListRequestRef(Span<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="ChatCommandListRequestRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
/// <param name="initialize">If set to <c>true</c>, the header data is automatically initialized and written to the underlying span.</param>
private ChatCommandListRequestRef(Span<byte> data, bool initialize)
{
this._data = data;
if (initialize)
{
var header = this.Header;
header.Type = HeaderType;
header.Code = Code;
header.Length = (byte)Math.Min(data.Length, Length);
header.SubCode = SubCode;
}
}
/// <summary>
/// Gets the header type of this data packet.
/// </summary>
public static byte HeaderType => 0xC1;
/// <summary>
/// Gets the operation code of this data packet.
/// </summary>
public static byte Code => 0xF5;
/// <summary>
/// Gets the operation sub-code of this data packet.
/// The <see cref="Code" /> is used as a grouping key.
/// </summary>
public static byte SubCode => 0x00;
/// <summary>
/// Gets the initial length of this data packet. When the size is dynamic, this value may be bigger than actually needed.
/// </summary>
public static int Length => 4;
/// <summary>
/// Gets the header of this packet.
/// </summary>
public C1HeaderWithSubCodeRef Header => new (this._data);
/// <summary>
/// Performs an implicit conversion from a Span of bytes to a <see cref="ChatCommandListRequest"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator ChatCommandListRequestRef(Span<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="ChatCommandListRequest"/> to a Span of bytes.
/// </summary>
/// <param name="packet">The packet as struct.</param>
/// <returns>The packet as byte span.</returns>
public static implicit operator Span<byte>(ChatCommandListRequestRef packet) => packet._data;
}

View File

@@ -5574,5 +5574,30 @@ public static class ConnectionExtensions
return packet.Header.Length;
}
await connection.SendAsync(WritePacket).ConfigureAwait(false);
}
/// <summary>
/// Sends a <see cref="ChatCommandListRequest" /> to this connection.
/// </summary>
/// <param name="connection">The connection.</param>
/// <remarks>
/// Is sent by the client when: 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.
/// Causes reaction on server side: The server sends an AvailableChatCommand message for each available chat command.
/// </remarks>
public static async ValueTask SendChatCommandListRequestAsync(this IConnection? connection)
{
if (connection is null)
{
return;
}
int WritePacket()
{
var length = ChatCommandListRequestRef.Length;
var packet = new ChatCommandListRequestRef(connection.Output.GetSpan(length)[..length]);
return packet.Header.Length;
}
await connection.SendAsync(WritePacket).ConfigureAwait(false);
}}

View File

@@ -31163,6 +31163,221 @@ public readonly struct ScoreEntry
set => WriteUInt32BigEndian(this._data.Span[13..], value);
}
}
}
/// <summary>
/// Is sent by the server when: After the client requested the list of available chat commands. One message is sent for each command which is available to the player.
/// Causes reaction on client side: 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.
/// </summary>
public readonly struct AvailableChatCommand
{
private readonly Memory<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="AvailableChatCommand"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public AvailableChatCommand(Memory<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AvailableChatCommand"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
/// <param name="initialize">If set to <c>true</c>, the header data is automatically initialized and written to the underlying span.</param>
private AvailableChatCommand(Memory<byte> data, bool initialize)
{
this._data = data;
if (initialize)
{
var header = this.Header;
header.Type = HeaderType;
header.Code = Code;
header.Length = (ushort)data.Length;
header.SubCode = SubCode;
}
}
/// <summary>
/// Gets the header type of this data packet.
/// </summary>
public static byte HeaderType => 0xC2;
/// <summary>
/// Gets the operation code of this data packet.
/// </summary>
public static byte Code => 0xF5;
/// <summary>
/// Gets the operation sub-code of this data packet.
/// The <see cref="Code" /> is used as a grouping key.
/// </summary>
public static byte SubCode => 0x01;
/// <summary>
/// Gets the header of this packet.
/// </summary>
public C2HeaderWithSubCode Header => new (this._data);
/// <summary>
/// Gets or sets the index of this command within the list, starting at 0.
/// </summary>
public byte Index
{
get => this._data.Span[5];
set => this._data.Span[5] = value;
}
/// <summary>
/// Gets or sets the total number of commands which are available to the player, so that the client knows when it received all of them.
/// </summary>
public byte Count
{
get => this._data.Span[6];
set => this._data.Span[6] = value;
}
/// <summary>
/// Gets or sets the character status which is required to execute the command.
/// </summary>
public CharacterStatus MinimumCharacterStatus
{
get => (CharacterStatus)this._data.Span[7];
set => this._data.Span[7] = (byte)value;
}
/// <summary>
/// Gets or sets the parameter count.
/// </summary>
public byte ParameterCount
{
get => this._data.Span[8];
set => this._data.Span[8] = value;
}
/// <summary>
/// Gets or sets the command including its slash, e.g. '/item'.
/// </summary>
public string Command
{
get => this._data.Span.ExtractString(9, 32, System.Text.Encoding.UTF8);
set => this._data.Slice(9, 32).Span.WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the name of the command, in the language of the player.
/// </summary>
public string Name
{
get => this._data.Span.ExtractString(41, 48, System.Text.Encoding.UTF8);
set => this._data.Slice(41, 48).Span.WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the description of the command, in the language of the player.
/// </summary>
public string Description
{
get => this._data.Span.ExtractString(89, 256, System.Text.Encoding.UTF8);
set => this._data.Slice(89, 256).Span.WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets the <see cref="ChatCommandParameter"/> of the specified index.
/// </summary>
public ChatCommandParameter this[int index] => new (this._data.Slice(345 + index * ChatCommandParameter.Length));
/// <summary>
/// Performs an implicit conversion from a Memory of bytes to a <see cref="AvailableChatCommand"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator AvailableChatCommand(Memory<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="AvailableChatCommand"/> to a Memory of bytes.
/// </summary>
/// <param name="packet">The packet as struct.</param>
/// <returns>The packet as byte span.</returns>
public static implicit operator Memory<byte>(AvailableChatCommand packet) => packet._data;
/// <summary>
/// Calculates the size of the packet for the specified count of <see cref="ChatCommandParameter"/>.
/// </summary>
/// <param name="parametersCount">The count of <see cref="ChatCommandParameter"/> from which the size will be calculated.</param>
public static int GetRequiredSize(int parametersCount) => parametersCount * ChatCommandParameter.Length + 345;
/// <summary>
/// Describes one parameter of a chat command, so that a user interface can offer an input for it..
/// </summary>
public readonly struct ChatCommandParameter
{
private readonly Memory<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="ChatCommandParameter"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public ChatCommandParameter(Memory<byte> data)
{
this._data = data;
}
/// <summary>
/// Gets the initial length of this data packet. When the size is dynamic, this value may be bigger than actually needed.
/// </summary>
public static int Length => 102;
/// <summary>
/// Gets or sets defines if the parameter has to be specified to execute the command.
/// </summary>
public bool IsRequired
{
get => this._data.Span.GetBoolean();
set => this._data.Span.SetBoolean(value);
}
/// <summary>
/// Gets or sets the kind of value which is expected, so that a fitting input can be shown.
/// </summary>
public ChatCommandParameterType Type
{
get => (ChatCommandParameterType)this._data.Span[1];
set => this._data.Span[1] = (byte)value;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name
{
get => this._data.Span.ExtractString(2, 32, System.Text.Encoding.UTF8);
set => this._data.Slice(2, 32).Span.WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the short name which is used in the 'shortName=value' notation. It's empty when the parameter can only be passed by its position.
/// </summary>
public string ShortName
{
get => this._data.Span.ExtractString(34, 20, System.Text.Encoding.UTF8);
set => this._data.Slice(34, 20).Span.WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the accepted values, separated by a pipe. It's empty when the parameter isn't limited to a set of values.
/// </summary>
public string ValidValues
{
get => this._data.Span.ExtractString(54, 48, System.Text.Encoding.UTF8);
set => this._data.Slice(54, 48).Span.WriteString(value, System.Text.Encoding.UTF8);
}
}
}
/// <summary>
/// Defines the role of a guild member.

View File

@@ -29527,3 +29527,218 @@ public readonly ref struct ScoreEntryRef
}
}
}
/// <summary>
/// Is sent by the server when: After the client requested the list of available chat commands. One message is sent for each command which is available to the player.
/// Causes reaction on client side: 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.
/// </summary>
public readonly ref struct AvailableChatCommandRef
{
private readonly Span<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="AvailableChatCommandRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public AvailableChatCommandRef(Span<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="AvailableChatCommandRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
/// <param name="initialize">If set to <c>true</c>, the header data is automatically initialized and written to the underlying span.</param>
private AvailableChatCommandRef(Span<byte> data, bool initialize)
{
this._data = data;
if (initialize)
{
var header = this.Header;
header.Type = HeaderType;
header.Code = Code;
header.Length = (ushort)data.Length;
header.SubCode = SubCode;
}
}
/// <summary>
/// Gets the header type of this data packet.
/// </summary>
public static byte HeaderType => 0xC2;
/// <summary>
/// Gets the operation code of this data packet.
/// </summary>
public static byte Code => 0xF5;
/// <summary>
/// Gets the operation sub-code of this data packet.
/// The <see cref="Code" /> is used as a grouping key.
/// </summary>
public static byte SubCode => 0x01;
/// <summary>
/// Gets the header of this packet.
/// </summary>
public C2HeaderWithSubCodeRef Header => new (this._data);
/// <summary>
/// Gets or sets the index of this command within the list, starting at 0.
/// </summary>
public byte Index
{
get => this._data[5];
set => this._data[5] = value;
}
/// <summary>
/// Gets or sets the total number of commands which are available to the player, so that the client knows when it received all of them.
/// </summary>
public byte Count
{
get => this._data[6];
set => this._data[6] = value;
}
/// <summary>
/// Gets or sets the character status which is required to execute the command.
/// </summary>
public CharacterStatus MinimumCharacterStatus
{
get => (CharacterStatus)this._data[7];
set => this._data[7] = (byte)value;
}
/// <summary>
/// Gets or sets the parameter count.
/// </summary>
public byte ParameterCount
{
get => this._data[8];
set => this._data[8] = value;
}
/// <summary>
/// Gets or sets the command including its slash, e.g. '/item'.
/// </summary>
public string Command
{
get => this._data.ExtractString(9, 32, System.Text.Encoding.UTF8);
set => this._data.Slice(9, 32).WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the name of the command, in the language of the player.
/// </summary>
public string Name
{
get => this._data.ExtractString(41, 48, System.Text.Encoding.UTF8);
set => this._data.Slice(41, 48).WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the description of the command, in the language of the player.
/// </summary>
public string Description
{
get => this._data.ExtractString(89, 256, System.Text.Encoding.UTF8);
set => this._data.Slice(89, 256).WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets the <see cref="ChatCommandParameterRef"/> of the specified index.
/// </summary>
public ChatCommandParameterRef this[int index] => new (this._data[(345 + index * ChatCommandParameterRef.Length)..]);
/// <summary>
/// Performs an implicit conversion from a Span of bytes to a <see cref="AvailableChatCommand"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator AvailableChatCommandRef(Span<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="AvailableChatCommand"/> to a Span of bytes.
/// </summary>
/// <param name="packet">The packet as struct.</param>
/// <returns>The packet as byte span.</returns>
public static implicit operator Span<byte>(AvailableChatCommandRef packet) => packet._data;
/// <summary>
/// Calculates the size of the packet for the specified count of <see cref="ChatCommandParameterRef"/>.
/// </summary>
/// <param name="parametersCount">The count of <see cref="ChatCommandParameterRef"/> from which the size will be calculated.</param>
public static int GetRequiredSize(int parametersCount) => parametersCount * ChatCommandParameterRef.Length + 345;
/// <summary>
/// Describes one parameter of a chat command, so that a user interface can offer an input for it..
/// </summary>
public readonly ref struct ChatCommandParameterRef
{
private readonly Span<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="ChatCommandParameterRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public ChatCommandParameterRef(Span<byte> data)
{
this._data = data;
}
/// <summary>
/// Gets the initial length of this data packet. When the size is dynamic, this value may be bigger than actually needed.
/// </summary>
public static int Length => 102;
/// <summary>
/// Gets or sets defines if the parameter has to be specified to execute the command.
/// </summary>
public bool IsRequired
{
get => this._data.GetBoolean();
set => this._data.SetBoolean(value);
}
/// <summary>
/// Gets or sets the kind of value which is expected, so that a fitting input can be shown.
/// </summary>
public ChatCommandParameterType Type
{
get => (ChatCommandParameterType)this._data[1];
set => this._data[1] = (byte)value;
}
/// <summary>
/// Gets or sets the name.
/// </summary>
public string Name
{
get => this._data.ExtractString(2, 32, System.Text.Encoding.UTF8);
set => this._data.Slice(2, 32).WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the short name which is used in the 'shortName=value' notation. It's empty when the parameter can only be passed by its position.
/// </summary>
public string ShortName
{
get => this._data.ExtractString(34, 20, System.Text.Encoding.UTF8);
set => this._data.Slice(34, 20).WriteString(value, System.Text.Encoding.UTF8);
}
/// <summary>
/// Gets or sets the accepted values, separated by a pipe. It's empty when the parameter isn't limited to a set of values.
/// </summary>
public string ValidValues
{
get => this._data.ExtractString(54, 48, System.Text.Encoding.UTF8);
set => this._data.Slice(54, 48).WriteString(value, System.Text.Encoding.UTF8);
}
}
}