feat(hs): raise statue HP, transform players in-battle, per-player team roster packet, drop wing-unequip
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -30892,6 +30892,133 @@ public readonly struct HeykelSavasiHudState
|
||||
/// <returns>The packet as byte span.</returns>
|
||||
public static implicit operator Memory<byte>(HeykelSavasiHudState packet) => packet._data;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Is sent by the server when: Periodically (about once every one to two seconds) while the Heykel Savasi (Statue War) event is open for registration, in its pre-battle countdown, or being played.
|
||||
/// Causes reaction on client side: The client tints each listed nearby player red or blue according to its team.
|
||||
/// </summary>
|
||||
public readonly struct HeykelSavasiTeamRoster
|
||||
{
|
||||
private readonly Memory<byte> _data;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeykelSavasiTeamRoster"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="data">The underlying data.</param>
|
||||
public HeykelSavasiTeamRoster(Memory<byte> data)
|
||||
: this(data, true)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeykelSavasiTeamRoster"/> 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 HeykelSavasiTeamRoster(Memory<byte> data, bool initialize)
|
||||
{
|
||||
this._data = data;
|
||||
if (initialize)
|
||||
{
|
||||
var header = this.Header;
|
||||
header.Type = HeaderType;
|
||||
header.Code = Code;
|
||||
header.Length = (byte)data.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 => 0xFC;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the header of this packet.
|
||||
/// </summary>
|
||||
public C1Header Header => new (this._data);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of player-team entries which follow.
|
||||
/// </summary>
|
||||
public byte Count
|
||||
{
|
||||
get => this._data.Span[3];
|
||||
set => this._data.Span[3] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="PlayerTeam"/> of the specified index.
|
||||
/// </summary>
|
||||
public PlayerTeam this[int index] => new (this._data.Slice(4 + index * PlayerTeam.Length));
|
||||
|
||||
/// <summary>
|
||||
/// Performs an implicit conversion from a Memory of bytes to a <see cref="HeykelSavasiTeamRoster"/>.
|
||||
/// </summary>
|
||||
/// <param name="packet">The packet as span.</param>
|
||||
/// <returns>The packet as struct.</returns>
|
||||
public static implicit operator HeykelSavasiTeamRoster(Memory<byte> packet) => new (packet, false);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an implicit conversion from <see cref="HeykelSavasiTeamRoster"/> 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>(HeykelSavasiTeamRoster packet) => packet._data;
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the size of the packet for the specified count of <see cref="PlayerTeam"/>.
|
||||
/// </summary>
|
||||
/// <param name="playersCount">The count of <see cref="PlayerTeam"/> from which the size will be calculated.</param>
|
||||
|
||||
public static int GetRequiredSize(int playersCount) => playersCount * PlayerTeam.Length + 4;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Maps a player's network id to its Heykel Savasi team..
|
||||
/// </summary>
|
||||
public readonly struct PlayerTeam
|
||||
{
|
||||
private readonly Memory<byte> _data;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayerTeam"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="data">The underlying data.</param>
|
||||
public PlayerTeam(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 => 3;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the network id of the player (same id used in the viewport/appearance packets).
|
||||
/// </summary>
|
||||
public ushort PlayerId
|
||||
{
|
||||
get => ReadUInt16BigEndian(this._data.Span);
|
||||
set => WriteUInt16BigEndian(this._data.Span, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets 1 = red, 2 = blue.
|
||||
/// </summary>
|
||||
public byte Team
|
||||
{
|
||||
get => this._data.Span[2];
|
||||
set => this._data.Span[2] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Defines the role of a guild member.
|
||||
/// </summary>
|
||||
|
||||
@@ -11139,6 +11139,50 @@
|
||||
</Field>
|
||||
</Fields>
|
||||
</Packet>
|
||||
<Packet>
|
||||
<HeaderType>C1Header</HeaderType>
|
||||
<Code>FC</Code>
|
||||
<Name>HeykelSavasiTeamRoster</Name>
|
||||
<Direction>ServerToClient</Direction>
|
||||
<SentWhen>Periodically (about once every one to two seconds) while the Heykel Savasi (Statue War) event is open for registration, in its pre-battle countdown, or being played.</SentWhen>
|
||||
<CausedReaction>The client tints each listed nearby player red or blue according to its team.</CausedReaction>
|
||||
<Fields>
|
||||
<Field>
|
||||
<Index>3</Index>
|
||||
<Type>Byte</Type>
|
||||
<Name>Count</Name>
|
||||
<Description>The number of player-team entries which follow.</Description>
|
||||
</Field>
|
||||
<Field>
|
||||
<Index>4</Index>
|
||||
<Type>Structure[]</Type>
|
||||
<TypeName>PlayerTeam</TypeName>
|
||||
<Name>Players</Name>
|
||||
<ItemCountField>Count</ItemCountField>
|
||||
</Field>
|
||||
</Fields>
|
||||
<Structures>
|
||||
<Structure>
|
||||
<Name>PlayerTeam</Name>
|
||||
<Description>Maps a player's network id to its Heykel Savasi team.</Description>
|
||||
<Length>3</Length>
|
||||
<Fields>
|
||||
<Field>
|
||||
<Index>0</Index>
|
||||
<Type>ShortBigEndian</Type>
|
||||
<Name>PlayerId</Name>
|
||||
<Description>The network id of the player (same id used in the viewport/appearance packets).</Description>
|
||||
</Field>
|
||||
<Field>
|
||||
<Index>2</Index>
|
||||
<Type>Byte</Type>
|
||||
<Name>Team</Name>
|
||||
<Description>1 = red, 2 = blue.</Description>
|
||||
</Field>
|
||||
</Fields>
|
||||
</Structure>
|
||||
</Structures>
|
||||
</Packet>
|
||||
</Packets>
|
||||
<Enums>
|
||||
<Enum>
|
||||
|
||||
@@ -29255,3 +29255,130 @@ public readonly ref struct HeykelSavasiHudStateRef
|
||||
/// <returns>The packet as byte span.</returns>
|
||||
public static implicit operator Span<byte>(HeykelSavasiHudStateRef packet) => packet._data;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Is sent by the server when: Periodically (about once every one to two seconds) while the Heykel Savasi (Statue War) event is open for registration, in its pre-battle countdown, or being played.
|
||||
/// Causes reaction on client side: The client tints each listed nearby player red or blue according to its team.
|
||||
/// </summary>
|
||||
public readonly ref struct HeykelSavasiTeamRosterRef
|
||||
{
|
||||
private readonly Span<byte> _data;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeykelSavasiTeamRosterRef"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="data">The underlying data.</param>
|
||||
public HeykelSavasiTeamRosterRef(Span<byte> data)
|
||||
: this(data, true)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeykelSavasiTeamRosterRef"/> 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 HeykelSavasiTeamRosterRef(Span<byte> data, bool initialize)
|
||||
{
|
||||
this._data = data;
|
||||
if (initialize)
|
||||
{
|
||||
var header = this.Header;
|
||||
header.Type = HeaderType;
|
||||
header.Code = Code;
|
||||
header.Length = (byte)data.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 => 0xFC;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the header of this packet.
|
||||
/// </summary>
|
||||
public C1HeaderRef Header => new (this._data);
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the number of player-team entries which follow.
|
||||
/// </summary>
|
||||
public byte Count
|
||||
{
|
||||
get => this._data[3];
|
||||
set => this._data[3] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="PlayerTeamRef"/> of the specified index.
|
||||
/// </summary>
|
||||
public PlayerTeamRef this[int index] => new (this._data[(4 + index * PlayerTeamRef.Length)..]);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an implicit conversion from a Span of bytes to a <see cref="HeykelSavasiTeamRoster"/>.
|
||||
/// </summary>
|
||||
/// <param name="packet">The packet as span.</param>
|
||||
/// <returns>The packet as struct.</returns>
|
||||
public static implicit operator HeykelSavasiTeamRosterRef(Span<byte> packet) => new (packet, false);
|
||||
|
||||
/// <summary>
|
||||
/// Performs an implicit conversion from <see cref="HeykelSavasiTeamRoster"/> 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>(HeykelSavasiTeamRosterRef packet) => packet._data;
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the size of the packet for the specified count of <see cref="PlayerTeamRef"/>.
|
||||
/// </summary>
|
||||
/// <param name="playersCount">The count of <see cref="PlayerTeamRef"/> from which the size will be calculated.</param>
|
||||
|
||||
public static int GetRequiredSize(int playersCount) => playersCount * PlayerTeamRef.Length + 4;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Maps a player's network id to its Heykel Savasi team..
|
||||
/// </summary>
|
||||
public readonly ref struct PlayerTeamRef
|
||||
{
|
||||
private readonly Span<byte> _data;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayerTeamRef"/> struct.
|
||||
/// </summary>
|
||||
/// <param name="data">The underlying data.</param>
|
||||
public PlayerTeamRef(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 => 3;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the network id of the player (same id used in the viewport/appearance packets).
|
||||
/// </summary>
|
||||
public ushort PlayerId
|
||||
{
|
||||
get => ReadUInt16BigEndian(this._data);
|
||||
set => WriteUInt16BigEndian(this._data, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets 1 = red, 2 = blue.
|
||||
/// </summary>
|
||||
public byte Team
|
||||
{
|
||||
get => this._data[2];
|
||||
set => this._data[2] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user