feat(net): D.2b-B B-Wire — WorldSession dispatch for 0x02CD/SetStackSize/InventoryRemoveObject
Add 3 new events (PlayerIntPropertyUpdated, StackSizeUpdated, InventoryObjectRemoved) and their payload record types near the existing ObjectIntPropertyUpdated event. Add 3 switch cases in the GameMessage dispatcher immediately after the PublicUpdatePropertyInt (0x02CE) branch for: - PrivateUpdatePropertyInt (0x02CD) — no-guid player-own property - SetStackSize (0x0197) — stack count + value update - InventoryRemoveObject (0x0024) — remove from inventory view No test seam on the switch; verified by build + parser tests (Tasks 3/4/5) + live run per codebase convention (see ObjectTableWiringTests comment). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3a9c188233
commit
672df23010
1 changed files with 38 additions and 0 deletions
|
|
@ -195,6 +195,25 @@ public sealed class WorldSession : IDisposable
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event Action<ObjectIntPropertyUpdate>? ObjectIntPropertyUpdated;
|
public event Action<ObjectIntPropertyUpdate>? ObjectIntPropertyUpdated;
|
||||||
|
|
||||||
|
/// <summary>Payload for <see cref="PlayerIntPropertyUpdated"/>: a PropertyInt change on
|
||||||
|
/// the player's OWN object (from PrivateUpdatePropertyInt 0x02CD — no guid on the wire).</summary>
|
||||||
|
public readonly record struct PlayerIntPropertyUpdate(uint Property, int Value);
|
||||||
|
|
||||||
|
/// <summary>Fires when the session parses a PrivateUpdatePropertyInt (0x02CD) — one
|
||||||
|
/// PropertyInt updated on the player. B-Wire routes EncumbranceVal (5) to the burden bar.</summary>
|
||||||
|
public event Action<PlayerIntPropertyUpdate>? PlayerIntPropertyUpdated;
|
||||||
|
|
||||||
|
/// <summary>Payload for <see cref="StackSizeUpdated"/>: SetStackSize (0x0197) — a stack's
|
||||||
|
/// count + value after a merge / split.</summary>
|
||||||
|
public readonly record struct StackSizeUpdate(uint Guid, int StackSize, int Value);
|
||||||
|
|
||||||
|
/// <summary>Fires when the session parses a SetStackSize (0x0197) top-level GameMessage.</summary>
|
||||||
|
public event Action<StackSizeUpdate>? StackSizeUpdated;
|
||||||
|
|
||||||
|
/// <summary>Fires when the session parses an InventoryRemoveObject (0x0024) — the guid left
|
||||||
|
/// the player's inventory view.</summary>
|
||||||
|
public event Action<uint>? InventoryObjectRemoved;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fires when the server sends a PlayerTeleport (0xF751) game message,
|
/// Fires when the server sends a PlayerTeleport (0xF751) game message,
|
||||||
/// signalling that the player is entering portal space. The uint payload
|
/// signalling that the player is entering portal space. The uint payload
|
||||||
|
|
@ -958,6 +977,25 @@ public sealed class WorldSession : IDisposable
|
||||||
ObjectIntPropertyUpdated?.Invoke(
|
ObjectIntPropertyUpdated?.Invoke(
|
||||||
new ObjectIntPropertyUpdate(p.Value.Guid, p.Value.Property, p.Value.Value));
|
new ObjectIntPropertyUpdate(p.Value.Guid, p.Value.Property, p.Value.Value));
|
||||||
}
|
}
|
||||||
|
else if (op == PrivateUpdatePropertyInt.Opcode)
|
||||||
|
{
|
||||||
|
var p = PrivateUpdatePropertyInt.TryParse(body);
|
||||||
|
if (p is not null)
|
||||||
|
PlayerIntPropertyUpdated?.Invoke(
|
||||||
|
new PlayerIntPropertyUpdate(p.Value.Property, p.Value.Value));
|
||||||
|
}
|
||||||
|
else if (op == SetStackSize.Opcode)
|
||||||
|
{
|
||||||
|
var p = SetStackSize.TryParse(body);
|
||||||
|
if (p is not null)
|
||||||
|
StackSizeUpdated?.Invoke(
|
||||||
|
new StackSizeUpdate(p.Value.Guid, p.Value.StackSize, p.Value.Value));
|
||||||
|
}
|
||||||
|
else if (op == InventoryRemoveObject.Opcode)
|
||||||
|
{
|
||||||
|
var p = InventoryRemoveObject.TryParse(body);
|
||||||
|
if (p is not null) InventoryObjectRemoved?.Invoke(p.Value.Guid);
|
||||||
|
}
|
||||||
else if (op == GameEventEnvelope.Opcode)
|
else if (op == GameEventEnvelope.Opcode)
|
||||||
{
|
{
|
||||||
// Phase F.1: 0xF7B0 is the GameEvent envelope. Parse the
|
// Phase F.1: 0xF7B0 is the GameEvent envelope. Parse the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue