- [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.
29 lines
740 B
C#
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; }
|
|
}
|
|
}
|