Skip to content

Commit

Permalink
Disconnect on Unknown Packet
Browse files Browse the repository at this point in the history
  • Loading branch information
FallenDev committed Dec 4, 2023
1 parent 0c0c0a3 commit 820003f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Chaos.Networking/Abstractions/ServerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,9 @@ public virtual ValueTask HandlePacketAsync(T client, in ClientPacket packet)
{
var handler = ClientHandlers[(byte)packet.OpCode];

if (handler is null)
return default;

return handler(client, in packet);
if (handler is not null) return handler(client, in packet);
client.Disconnect();
return default;
}

/// <summary>
Expand Down

0 comments on commit 820003f

Please sign in to comment.