ModernUO/Projects/Server/Network/PacketHandler.cs
Kamron Batman 97f311d7be
fix(core): Removes 6017 handler (#411)
- [X] Removes 6017 handler since it is only used in one place
- [X] Exposes a ref int to modify the packet length. This is acceptable since we technically have access to the entire reader/buffer.
2021-01-16 13:43:16 -08:00

29 lines
740 B
C#

using System;
namespace Server.Network
{
public delegate void OnPacketReceive(NetState state, CircularBufferReader reader, ref int packetLength);
public delegate TimeSpan ThrottlePacketCallback(NetState state);
public class PacketHandler
{
public PacketHandler(int packetID, int length, bool ingame, OnPacketReceive onReceive)
{
PacketID = packetID;
Length = length;
Ingame = ingame;
OnReceive = onReceive;
}
public int PacketID { get; }
public int Length { get; }
public OnPacketReceive OnReceive { get; }
public ThrottlePacketCallback ThrottleCallback { get; set; }
public bool Ingame { get; }
}
}