Quick stability fix trollface

This commit is contained in:
Sanae 2022-02-14 15:17:36 -06:00
parent 9b2d508a20
commit d0f060fab5
1 changed files with 3 additions and 1 deletions

View File

@ -184,11 +184,13 @@ public class Server {
client.CurrentCostume = costumePacket;
}
{
try {
if (header.Type is not PacketType.Cap and not PacketType.Player) Logger.Warn($"lol {header.Type}");
IPacket packet = (IPacket) Activator.CreateInstance(Constants.PacketIdMap[header.Type])!;
packet.Deserialize(memory.Memory.Span[Constants.HeaderSize..]);
PacketHandler?.Invoke(client, packet);
} catch {
// ignore failed packet deserialization!
}
await Broadcast(memory, client);