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:
parent
43afcc2adb
commit
01910e3fab
2 changed files with 26 additions and 4 deletions
|
|
@ -343,19 +343,24 @@ public static class GameEvents
|
|||
BinaryPrimitives.ReadUInt32LittleEndian(payload.Slice(8)));
|
||||
}
|
||||
|
||||
/// <summary>0x0022 InventoryPutObjInContainer: server puts item into container slot.</summary>
|
||||
/// <summary>0x0022 InventoryPutObjInContainer: server puts item into container slot.
|
||||
/// 4 fields (ACE GameEventItemServerSaysContainId.cs): itemGuid, containerGuid,
|
||||
/// placement, containerType. ContainerType (0=item,1=container,2=foci) confirmed
|
||||
/// vs holtburger events.rs fixture (slot=3 type=1).</summary>
|
||||
public readonly record struct InventoryPutObjInContainer(
|
||||
uint ItemGuid,
|
||||
uint ContainerGuid,
|
||||
uint Placement);
|
||||
uint Placement,
|
||||
uint ContainerType);
|
||||
|
||||
public static InventoryPutObjInContainer? ParsePutObjInContainer(ReadOnlySpan<byte> payload)
|
||||
{
|
||||
if (payload.Length < 12) return null;
|
||||
if (payload.Length < 16) return null;
|
||||
return new InventoryPutObjInContainer(
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(payload),
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(payload.Slice(4)),
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(payload.Slice(8)));
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(payload.Slice(8)),
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(payload.Slice(12)));
|
||||
}
|
||||
|
||||
/// <summary>0x0196 ViewContents: full contents list of a container you opened.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue