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:
parent
25a75fdf24
commit
7d9bc9ff0a
31 changed files with 190 additions and 157 deletions
|
|
@ -29,7 +29,7 @@ namespace Server.Items
|
|||
IncomingPackets.Register(0x93, 99, true, &OldHeaderChange);
|
||||
}
|
||||
|
||||
public static void OldHeaderChange(NetState state, SpanReader reader, int packetLength)
|
||||
public static void OldHeaderChange(NetState state, SpanReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ namespace Server.Items
|
|||
book.Author = Utility.FixHtml(author);
|
||||
}
|
||||
|
||||
public static void HeaderChange(NetState state, SpanReader reader, int packetLength)
|
||||
public static void HeaderChange(NetState state, SpanReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
@ -84,7 +84,7 @@ namespace Server.Items
|
|||
book.Author = Utility.FixHtml(author);
|
||||
}
|
||||
|
||||
public static void ContentChange(NetState state, SpanReader reader, int packetLength)
|
||||
public static void ContentChange(NetState state, SpanReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace Server.Network
|
|||
return $"{seconds} second{(seconds == 1 ? "" : "s")}";
|
||||
}
|
||||
|
||||
public static void BBClientRequest(NetState state, SpanReader reader, int packetLength)
|
||||
public static void BBClientRequest(NetState state, SpanReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ namespace Server.Engines.Mahjong
|
|||
RegisterSubCommand(0x18, MoveDealerIndicator);
|
||||
}
|
||||
|
||||
public static void OnPacket(NetState state, SpanReader reader, int packetLength)
|
||||
public static void OnPacket(NetState state, SpanReader reader)
|
||||
{
|
||||
var game = World.FindItem((Serial)reader.ReadUInt32()) as MahjongGame;
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Server.Network
|
|||
IncomingPackets.Register(0x56, 11, true, &OnMapCommand);
|
||||
}
|
||||
|
||||
private static void OnMapCommand(NetState state, SpanReader reader, int packetLength)
|
||||
private static void OnMapCommand(NetState state, SpanReader reader)
|
||||
{
|
||||
var from = state.Mobile;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue