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
|
|
@ -21,7 +21,7 @@ public unsafe class PacketHandler
|
|||
{
|
||||
private readonly int _length;
|
||||
|
||||
public PacketHandler(int packetID, int length, bool ingame, delegate*<NetState, SpanReader, int, void> onReceive)
|
||||
public PacketHandler(int packetID, int length, bool ingame, delegate*<NetState, SpanReader, void> onReceive)
|
||||
{
|
||||
_length = length;
|
||||
PacketID = packetID;
|
||||
|
|
@ -33,7 +33,7 @@ public unsafe class PacketHandler
|
|||
|
||||
public virtual int GetLength(NetState ns) => _length;
|
||||
|
||||
public delegate*<NetState, SpanReader, int, void> OnReceive { get; }
|
||||
public delegate*<NetState, SpanReader, void> OnReceive { get; }
|
||||
|
||||
public delegate*<int, NetState, out bool, bool> ThrottleCallback { get; set; }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue