fix(wire): send NotifyNotEnoughInvSpace with its own message ID

WIRE FIX. DLU sent NotifyNotEnoughInvSpace with the ID of
VehicleNotifyFinishedRace (1396). The 1.10.64 client registers it as
NOTIFY_NOT_ENOUGH_INV_SPACE (1516, 0x00545c90) and reads freeSlotsNeeded
followed by the optional inventoryType (0x00d8b850), which is what the
payload already was. Only the message ID changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-27 08:10:25 -05:00
parent 9843b81c51
commit c4583d7fc6
3 changed files with 15 additions and 6 deletions

View File

@@ -202,7 +202,16 @@ TEST_F(InventoryMessagesTests, SmallMessagesMatchLegacy) {
msg.target = target;
msg.freeSlotsNeeded = slots;
msg.inventoryType = type;
ExpectSameAsLegacy([&](const SystemAddress& a) { LegacyGameMessages::SendNotifyNotEnoughInvSpace(target, slots, type, a); }, msg);
// WIRE FIX: the legacy bytes carry VEHICLE_NOTIFY_FINISHED_RACE (1396) as the message ID; everything
// else is unchanged, so compare against them with the ID (bytes 16-17, after the header and object ID)
// swapped for NOTIFY_NOT_ENOUGH_INV_SPACE (1516).
const auto legacy = Capture([&] { LegacyGameMessages::SendNotifyNotEnoughInvSpace(target, slots, type, ClientAddress()); });
ASSERT_FALSE(legacy.empty());
auto expected = FromCapture(legacy[0]);
ASSERT_EQ(expected.bytes[16] | (expected.bytes[17] << 8), 1396);
expected.bytes[16] = 1516 & 0xFF;
expected.bytes[17] = 1516 >> 8;
EXPECT_PACKET_EQ(expected, StructPacket(msg));
const auto copy = RoundTrip(msg);
EXPECT_EQ(copy.freeSlotsNeeded, slots);
EXPECT_EQ(copy.inventoryType, type);