fix: Fixes thread guard and cleans up incoming packet reader (#1641)

### Summary
* Fixes syntax compile error when THREADGUARD is enabled.
* Removes `int packetLength` from incoming packet handles since they aren't needed.

### Developer Notes
Incoming packet handler `SpanReader` is now properly scoped to that packet by length.
This commit is contained in:
Kamron Batman 2023-12-19 17:04:09 -08:00 • committed by GitHub
parent 25a75fdf24
commit 7d9bc9ff0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 190 additions and 157 deletions

View file

@ -26,7 +26,7 @@ public static class IncomingVendorPackets
IncomingPackets.Register(0x9F, 0, true, &VendorSellReply);
}
public static void VendorBuyReply(NetState state, SpanReader reader, int packetLength)
public static void VendorBuyReply(NetState state, SpanReader reader)
{
var vendor = World.FindMobile((Serial)reader.ReadUInt32());
@ -39,7 +39,7 @@ public static class IncomingVendorPackets
if (!vendor.Deleted && Utility.InRange(vendor.Location, state.Mobile.Location, 10) && flag == 0x02)
{
var msgSize = packetLength - 8; // Remaining bytes
var msgSize = reader.Remaining;
if (msgSize / 7 > 100)
{
@ -66,7 +66,7 @@ public static class IncomingVendorPackets
state.SendEndVendorBuy(vendor.Serial);
}
public static void VendorSellReply(NetState state, SpanReader reader, int packetLength)
public static void VendorSellReply(NetState state, SpanReader reader)
{
var serial = (Serial)reader.ReadUInt32();
var vendor = World.FindMobile(serial);