0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-22 11:15:15 +00:00

Quick stability fix trollface

This commit is contained in:
Sanae 2022-02-14 15:17:36 -06:00
parent 9b2d508a20
commit d0f060fab5

View file

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