Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The characters enters the game world.
| Index | Length | Data Type | Value | Description |
|-------|--------|-----------|-------|-------------|
| 0 | 1 | Byte | 0xC3 | [Packet type](PacketTypes.md) |
| 1 | 1 | Byte | 96 | Packet header - length of the packet |
| 1 | 1 | Byte | 92 | Packet header - length of the packet |
| 2 | 1 | Byte | 0xF3 | Packet header - packet type identifier |
| 3 | 1 | Byte | 0x03 | Packet header - sub packet type identifier |
| 4 | 1 | Byte | | X |
Expand Down Expand Up @@ -46,6 +46,7 @@ The characters enters the game world.
| 84 | 2 | ShortLittleEndian | | MagicSpeed |
| 86 | 2 | ShortLittleEndian | | MaximumAttackSpeed |
| 88 | 1 | Byte | | InventoryExtensions |
| 90 | 2 | ShortLittleEndian | | Resets |

### CharacterHeroState Enum

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ await connection.SendCharacterInformationExtendedAsync(
(ushort)this._player.Attributes[Stats.AttackSpeed],
(ushort)this._player.Attributes[Stats.MagicSpeed],
(ushort)maxAttackSpeed,
(byte)this._player.SelectedCharacter.InventoryExtensions)
(byte)this._player.SelectedCharacter.InventoryExtensions,
(ushort)this._player.Attributes[Stats.Resets])
.ConfigureAwait(false);

if (this._player.SelectedCharacter.CharacterClass!.IsMasterClass)
Expand Down
4 changes: 3 additions & 1 deletion src/Network/Packets/ServerToClient/ConnectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3385,11 +3385,12 @@ int WritePacket()
/// <param name="magicSpeed">The magic speed.</param>
/// <param name="maximumAttackSpeed">The maximum attack speed.</param>
/// <param name="inventoryExtensions">The inventory extensions.</param>
/// <param name="resets">The resets.</param>
/// <remarks>
/// Is sent by the server when: After the character was selected by the player and entered the game.
/// Causes reaction on client side: The characters enters the game world.
/// </remarks>
public static async ValueTask SendCharacterInformationExtendedAsync(this IConnection? connection, byte @x, byte @y, ushort @mapId, ulong @currentExperience, ulong @experienceForNextLevel, ushort @levelUpPoints, ushort @strength, ushort @agility, ushort @vitality, ushort @energy, ushort @leadership, uint @currentHealth, uint @maximumHealth, uint @currentMana, uint @maximumMana, uint @currentShield, uint @maximumShield, uint @currentAbility, uint @maximumAbility, uint @money, CharacterHeroState @heroState, CharacterStatus @status, ushort @usedFruitPoints, ushort @maxFruitPoints, ushort @usedNegativeFruitPoints, ushort @maxNegativeFruitPoints, ushort @attackSpeed, ushort @magicSpeed, ushort @maximumAttackSpeed, byte @inventoryExtensions)
public static async ValueTask SendCharacterInformationExtendedAsync(this IConnection? connection, byte @x, byte @y, ushort @mapId, ulong @currentExperience, ulong @experienceForNextLevel, ushort @levelUpPoints, ushort @strength, ushort @agility, ushort @vitality, ushort @energy, ushort @leadership, uint @currentHealth, uint @maximumHealth, uint @currentMana, uint @maximumMana, uint @currentShield, uint @maximumShield, uint @currentAbility, uint @maximumAbility, uint @money, CharacterHeroState @heroState, CharacterStatus @status, ushort @usedFruitPoints, ushort @maxFruitPoints, ushort @usedNegativeFruitPoints, ushort @maxNegativeFruitPoints, ushort @attackSpeed, ushort @magicSpeed, ushort @maximumAttackSpeed, byte @inventoryExtensions, ushort @resets)
{
if (connection is null)
{
Expand Down Expand Up @@ -3430,6 +3431,7 @@ int WritePacket()
packet.MagicSpeed = @magicSpeed;
packet.MaximumAttackSpeed = @maximumAttackSpeed;
packet.InventoryExtensions = @inventoryExtensions;
packet.Resets = @resets;

return packet.Header.Length;
}
Expand Down
11 changes: 10 additions & 1 deletion src/Network/Packets/ServerToClient/ServerToClientPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17141,7 +17141,7 @@ private CharacterInformationExtended(Memory<byte> data, bool initialize)
/// <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 => 96;
public static int Length => 92;

/// <summary>
/// Gets the header of this packet.
Expand Down Expand Up @@ -17418,6 +17418,15 @@ public byte InventoryExtensions
set => this._data.Span[88] = value;
}

/// <summary>
/// Gets or sets the resets.
/// </summary>
public ushort Resets
{
get => ReadUInt16LittleEndian(this._data.Span[90..]);
set => WriteUInt16LittleEndian(this._data.Span[90..], value);
}

/// <summary>
/// Performs an implicit conversion from a Memory of bytes to a <see cref="CharacterInformationExtended"/>.
/// </summary>
Expand Down
8 changes: 7 additions & 1 deletion src/Network/Packets/ServerToClient/ServerToClientPackets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6322,7 +6322,7 @@
<Code>F3</Code>
<SubCode>03</SubCode>
<Name>CharacterInformationExtended</Name>
<Length>96</Length>
<Length>92</Length>
<Direction>ServerToClient</Direction>
<SentWhen>After the character was selected by the player and entered the game.</SentWhen>
<CausedReaction>The characters enters the game world.</CausedReaction>
Expand Down Expand Up @@ -6479,6 +6479,12 @@
<Type>Byte</Type>
<Name>InventoryExtensions</Name>
</Field>
<!-- 1 spare byte here -->
<Field>
<Index>90</Index>
<Type>ShortLittleEndian</Type>
<Name>Resets</Name>
</Field>
</Fields>
</Packet>
<Packet>
Expand Down
11 changes: 10 additions & 1 deletion src/Network/Packets/ServerToClient/ServerToClientPacketsRef.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16289,7 +16289,7 @@ private CharacterInformationExtendedRef(Span<byte> data, bool initialize)
/// <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 => 96;
public static int Length => 92;

/// <summary>
/// Gets the header of this packet.
Expand Down Expand Up @@ -16566,6 +16566,15 @@ public byte InventoryExtensions
set => this._data[88] = value;
}

/// <summary>
/// Gets or sets the resets.
/// </summary>
public ushort Resets
{
get => ReadUInt16LittleEndian(this._data[90..]);
set => WriteUInt16LittleEndian(this._data[90..], value);
}

/// <summary>
/// Performs an implicit conversion from a Span of bytes to a <see cref="CharacterInformationExtended"/>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3423,7 +3423,7 @@ public void CharacterLevelUpdateExtended_PacketSizeValidation()
public void CharacterInformationExtended_PacketSizeValidation()
{
// Fixed-length packet validation
const int expectedLength = 96;
const int expectedLength = 92;
var actualLength = CharacterInformationExtendedRef.Length;

Assert.That(actualLength, Is.EqualTo(expectedLength),
Expand Down Expand Up @@ -3548,6 +3548,10 @@ public void CharacterInformationExtended_PacketSizeValidation()
// Validate field 'InventoryExtensions' boundary
Assert.That(88 + 1, Is.LessThanOrEqualTo(expectedLength),
"Field 'InventoryExtensions' exceeds packet boundary");

// Validate field 'Resets' boundary
Assert.That(90 + 2, Is.LessThanOrEqualTo(expectedLength),
"Field 'Resets' exceeds packet boundary");
}

/// <summary>
Expand Down