fix(net): D.2b-B B-Wire — ParsePutObjInContainer reads containerType (4th field)

0x0022 InventoryPutObjInContainer carries 4 u32s per ACE
GameEventItemServerSaysContainId.cs: itemGuid, containerGuid, placement,
containerType. The parser was reading only 3 (12 bytes) and silently
dropping containerType. Fixed the record struct to add ContainerType and
raised the length guard to 16. GameEventWiring caller uses only
.ItemGuid/.ContainerGuid/.Placement — adding a positional field is
source-compatible. 1 new test in GameEventsInventoryTests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-06-21 18:55:14 +02:00
parent 43afcc2adb
commit 01910e3fab
2 changed files with 26 additions and 4 deletions

View file

@ -42,4 +42,21 @@ public sealed class GameEventsInventoryTests
[Fact]
public void ParseViewContents_truncated_returnsNull()
=> Assert.Null(GameEvents.ParseViewContents(new byte[4]));
[Fact]
public void ParsePutObjInContainer_readsAllFourFields()
{
var b = new byte[16];
BinaryPrimitives.WriteUInt32LittleEndian(b.AsSpan(0), 0x50000A01u); // itemGuid
BinaryPrimitives.WriteUInt32LittleEndian(b.AsSpan(4), 0x500000C9u); // containerGuid
BinaryPrimitives.WriteUInt32LittleEndian(b.AsSpan(8), 3u); // placement
BinaryPrimitives.WriteUInt32LittleEndian(b.AsSpan(12), 1u); // containerType
var p = GameEvents.ParsePutObjInContainer(b);
Assert.NotNull(p);
Assert.Equal(0x50000A01u, p!.Value.ItemGuid);
Assert.Equal(0x500000C9u, p.Value.ContainerGuid);
Assert.Equal(3u, p.Value.Placement);
Assert.Equal(1u, p.Value.ContainerType);
}
}