This commit is contained in:
2025-12-14 01:19:31 +01:00
8 changed files with 289 additions and 134 deletions

View File

@@ -15,6 +15,14 @@ namespace KCM.Packets.Handlers
{
public class PacketHandler
{
[ThreadStatic]
private static bool isHandlingPacket;
public static bool IsHandlingPacket
{
get { return isHandlingPacket; }
}
public static Dictionary<ushort, PacketRef> Packets = new Dictionary<ushort, PacketRef>();
public class PacketRef
{
@@ -183,6 +191,7 @@ namespace KCM.Packets.Handlers
{
try
{
isHandlingPacket = true;
packet.HandlePacketClient();
}
catch (Exception ex)
@@ -205,6 +214,10 @@ namespace KCM.Packets.Handlers
Main.helper.Log(ex.InnerException.StackTrace);
}
}
finally
{
isHandlingPacket = false;
}
}
/* if (PacketHandlers.TryGetValue(id, out PacketHandlerDelegate handler))