feat(hs): add open-team-panel (S2C) and team-select (C2S) packets

This commit is contained in:
Acentech Dev
2026-07-20 23:22:33 +03:00
parent cc0b7abb44
commit f5e1f46444
8 changed files with 430 additions and 0 deletions

View File

@@ -17525,6 +17525,85 @@ public readonly struct DuelChannelQuitRequest
/// <returns>The packet as byte span.</returns>
public static implicit operator Memory<byte>(DuelChannelQuitRequest packet) => packet._data;
}
/// <summary>
/// Is sent by the client when: A player selects a team (Red or Blue) in the Heykel Savasi (Statue War) team selection panel.
/// Causes reaction on server side: The server assigns the player to the requested team, if possible, and updates the event state accordingly.
/// </summary>
public readonly struct HeykelSavasiTeamSelect
{
private readonly Memory<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiTeamSelect"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public HeykelSavasiTeamSelect(Memory<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiTeamSelect"/> 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 HeykelSavasiTeamSelect(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);
}
}
/// <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 => 0xFA;
/// <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 C1Header Header => new (this._data);
/// <summary>
/// Gets or sets 1 = Red team, 2 = Blue team.
/// </summary>
public byte Team
{
get => this._data.Span[3];
set => this._data.Span[3] = value;
}
/// <summary>
/// Performs an implicit conversion from a Memory of bytes to a <see cref="HeykelSavasiTeamSelect"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator HeykelSavasiTeamSelect(Memory<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="HeykelSavasiTeamSelect"/> 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>(HeykelSavasiTeamSelect packet) => packet._data;
}
/// <summary>
/// The state of the trade button.
/// </summary>

View File

@@ -4251,6 +4251,23 @@
<Fields>
</Fields>
</Packet>
<Packet>
<HeaderType>C1Header</HeaderType>
<Code>FA</Code>
<Name>HeykelSavasiTeamSelect</Name>
<Length>4</Length>
<Direction>ClientToServer</Direction>
<SentWhen>A player selects a team (Red or Blue) in the Heykel Savasi (Statue War) team selection panel.</SentWhen>
<CausedReaction>The server assigns the player to the requested team, if possible, and updates the event state accordingly.</CausedReaction>
<Fields>
<Field>
<Index>3</Index>
<Type>Byte</Type>
<Name>Team</Name>
<Description>1 = Red team, 2 = Blue team.</Description>
</Field>
</Fields>
</Packet>
</Packets>
<Enums>
<Enum>

View File

@@ -17318,3 +17318,82 @@ public readonly ref struct DuelChannelQuitRequestRef
/// <returns>The packet as byte span.</returns>
public static implicit operator Span<byte>(DuelChannelQuitRequestRef packet) => packet._data;
}
/// <summary>
/// Is sent by the client when: A player selects a team (Red or Blue) in the Heykel Savasi (Statue War) team selection panel.
/// Causes reaction on server side: The server assigns the player to the requested team, if possible, and updates the event state accordingly.
/// </summary>
public readonly ref struct HeykelSavasiTeamSelectRef
{
private readonly Span<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiTeamSelectRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public HeykelSavasiTeamSelectRef(Span<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiTeamSelectRef"/> 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 HeykelSavasiTeamSelectRef(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);
}
}
/// <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 => 0xFA;
/// <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 C1HeaderRef Header => new (this._data);
/// <summary>
/// Gets or sets 1 = Red team, 2 = Blue team.
/// </summary>
public byte Team
{
get => this._data[3];
set => this._data[3] = value;
}
/// <summary>
/// Performs an implicit conversion from a Span of bytes to a <see cref="HeykelSavasiTeamSelect"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator HeykelSavasiTeamSelectRef(Span<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="HeykelSavasiTeamSelect"/> 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>(HeykelSavasiTeamSelectRef packet) => packet._data;
}

View File

@@ -5546,5 +5546,33 @@ public static class ConnectionExtensions
return packet.Header.Length;
}
await connection.SendAsync(WritePacket).ConfigureAwait(false);
}
/// <summary>
/// Sends a <see cref="HeykelSavasiTeamSelect" /> to this connection.
/// </summary>
/// <param name="connection">The connection.</param>
/// <param name="team">1 = Red team, 2 = Blue team.</param>
/// <remarks>
/// Is sent by the client when: A player selects a team (Red or Blue) in the Heykel Savasi (Statue War) team selection panel.
/// Causes reaction on server side: The server assigns the player to the requested team, if possible, and updates the event state accordingly.
/// </remarks>
public static async ValueTask SendHeykelSavasiTeamSelectAsync(this IConnection? connection, byte @team)
{
if (connection is null)
{
return;
}
int WritePacket()
{
var length = HeykelSavasiTeamSelectRef.Length;
var packet = new HeykelSavasiTeamSelectRef(connection.Output.GetSpan(length)[..length]);
packet.Team = @team;
return packet.Header.Length;
}
await connection.SendAsync(WritePacket).ConfigureAwait(false);
}}

View File

@@ -6287,5 +6287,35 @@ public static class ConnectionExtensions
return packet.Header.Length;
}
await connection.SendAsync(WritePacket).ConfigureAwait(false);
}
/// <summary>
/// Sends a <see cref="HeykelSavasiOpenTeamPanel" /> to this connection.
/// </summary>
/// <param name="connection">The connection.</param>
/// <param name="redCount">The red count.</param>
/// <param name="blueCount">The blue count.</param>
/// <remarks>
/// Is sent by the server when: The Heykel Savasi (Statue War) event is available and the team selection panel should be shown to the player.
/// Causes reaction on client side: The client opens the team selection panel, showing the current balance of red and blue team members.
/// </remarks>
public static async ValueTask SendHeykelSavasiOpenTeamPanelAsync(this IConnection? connection, byte @redCount, byte @blueCount)
{
if (connection is null)
{
return;
}
int WritePacket()
{
var length = HeykelSavasiOpenTeamPanelRef.Length;
var packet = new HeykelSavasiOpenTeamPanelRef(connection.Output.GetSpan(length)[..length]);
packet.RedCount = @redCount;
packet.BlueCount = @blueCount;
return packet.Header.Length;
}
await connection.SendAsync(WritePacket).ConfigureAwait(false);
}}

View File

@@ -30671,6 +30671,94 @@ public readonly struct MapEventState
/// <returns>The packet as byte span.</returns>
public static implicit operator Memory<byte>(MapEventState packet) => packet._data;
}
/// <summary>
/// Is sent by the server when: The Heykel Savasi (Statue War) event is available and the team selection panel should be shown to the player.
/// Causes reaction on client side: The client opens the team selection panel, showing the current balance of red and blue team members.
/// </summary>
public readonly struct HeykelSavasiOpenTeamPanel
{
private readonly Memory<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiOpenTeamPanel"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public HeykelSavasiOpenTeamPanel(Memory<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiOpenTeamPanel"/> 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 HeykelSavasiOpenTeamPanel(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);
}
}
/// <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 => 0xFA;
/// <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 => 5;
/// <summary>
/// Gets the header of this packet.
/// </summary>
public C1Header Header => new (this._data);
/// <summary>
/// Gets or sets the red count.
/// </summary>
public byte RedCount
{
get => this._data.Span[3];
set => this._data.Span[3] = value;
}
/// <summary>
/// Gets or sets the blue count.
/// </summary>
public byte BlueCount
{
get => this._data.Span[4];
set => this._data.Span[4] = value;
}
/// <summary>
/// Performs an implicit conversion from a Memory of bytes to a <see cref="HeykelSavasiOpenTeamPanel"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator HeykelSavasiOpenTeamPanel(Memory<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="HeykelSavasiOpenTeamPanel"/> 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>(HeykelSavasiOpenTeamPanel packet) => packet._data;
}
/// <summary>
/// Defines the role of a guild member.
/// </summary>

View File

@@ -11067,6 +11067,27 @@
</Enum>
</Enums>
</Packet>
<Packet>
<HeaderType>C1Header</HeaderType>
<Code>FA</Code>
<Name>HeykelSavasiOpenTeamPanel</Name>
<Length>5</Length>
<Direction>ServerToClient</Direction>
<SentWhen>The Heykel Savasi (Statue War) event is available and the team selection panel should be shown to the player.</SentWhen>
<CausedReaction>The client opens the team selection panel, showing the current balance of red and blue team members.</CausedReaction>
<Fields>
<Field>
<Index>3</Index>
<Type>Byte</Type>
<Name>RedCount</Name>
</Field>
<Field>
<Index>4</Index>
<Type>Byte</Type>
<Name>BlueCount</Name>
</Field>
</Fields>
</Packet>
</Packets>
<Enums>
<Enum>

View File

@@ -29034,3 +29034,91 @@ public readonly ref struct MapEventStateRef
/// <returns>The packet as byte span.</returns>
public static implicit operator Span<byte>(MapEventStateRef packet) => packet._data;
}
/// <summary>
/// Is sent by the server when: The Heykel Savasi (Statue War) event is available and the team selection panel should be shown to the player.
/// Causes reaction on client side: The client opens the team selection panel, showing the current balance of red and blue team members.
/// </summary>
public readonly ref struct HeykelSavasiOpenTeamPanelRef
{
private readonly Span<byte> _data;
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiOpenTeamPanelRef"/> struct.
/// </summary>
/// <param name="data">The underlying data.</param>
public HeykelSavasiOpenTeamPanelRef(Span<byte> data)
: this(data, true)
{
}
/// <summary>
/// Initializes a new instance of the <see cref="HeykelSavasiOpenTeamPanelRef"/> 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 HeykelSavasiOpenTeamPanelRef(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);
}
}
/// <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 => 0xFA;
/// <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 => 5;
/// <summary>
/// Gets the header of this packet.
/// </summary>
public C1HeaderRef Header => new (this._data);
/// <summary>
/// Gets or sets the red count.
/// </summary>
public byte RedCount
{
get => this._data[3];
set => this._data[3] = value;
}
/// <summary>
/// Gets or sets the blue count.
/// </summary>
public byte BlueCount
{
get => this._data[4];
set => this._data[4] = value;
}
/// <summary>
/// Performs an implicit conversion from a Span of bytes to a <see cref="HeykelSavasiOpenTeamPanel"/>.
/// </summary>
/// <param name="packet">The packet as span.</param>
/// <returns>The packet as struct.</returns>
public static implicit operator HeykelSavasiOpenTeamPanelRef(Span<byte> packet) => new (packet, false);
/// <summary>
/// Performs an implicit conversion from <see cref="HeykelSavasiOpenTeamPanel"/> 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>(HeykelSavasiOpenTeamPanelRef packet) => packet._data;
}