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

@@ -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;
}