fix: Replaces throttlers and packet callbacks with function pointers (#1063)
Replaces multi-cast delegates with function pointers to gain 25% in performance and lower allocations.
This commit is contained in:
parent
b779d7737f
commit
f24b98f8e2
31 changed files with 189 additions and 172 deletions
|
|
@ -21,13 +21,13 @@ namespace Server.Network;
|
|||
|
||||
public static class IncomingItemPackets
|
||||
{
|
||||
public static void Configure()
|
||||
public static unsafe void Configure()
|
||||
{
|
||||
IncomingPackets.Register(0x07, 7, true, LiftReq);
|
||||
IncomingPackets.Register(new ContainerGridPacketHandler(0x08, 14, true, DropReq));
|
||||
IncomingPackets.Register(0x13, 10, true, EquipReq);
|
||||
IncomingPackets.Register(0xEC, 0, false, EquipMacro);
|
||||
IncomingPackets.Register(0xED, 0, false, UnequipMacro);
|
||||
IncomingPackets.Register(0x07, 7, true, &LiftReq);
|
||||
IncomingPackets.Register(new ContainerGridPacketHandler(0x08, 14, true, &DropReq));
|
||||
IncomingPackets.Register(0x13, 10, true, &EquipReq);
|
||||
IncomingPackets.Register(0xEC, 0, false, &EquipMacro);
|
||||
IncomingPackets.Register(0xED, 0, false, &UnequipMacro);
|
||||
}
|
||||
|
||||
public static void LiftReq(NetState state, CircularBufferReader reader, int packetLength)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue