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>