diff --git a/Server/Client.cs b/Server/Client.cs index ce161ef..6319f5e 100644 --- a/Server/Client.cs +++ b/Server/Client.cs @@ -48,11 +48,15 @@ public class Client : IDisposable { } public async Task Send(Memory data, Client? sender) { - if (!Connected) { - // Server.Logger.Info($"Didn't send {MemoryMarshal.Read(data.Span[16..])} to {Id} because they weren't connected yet"); + PacketType packetType = MemoryMarshal.Read(data.Span[16..]); + if (!Connected && packetType is not PacketType.Connect) { + Server.Logger.Error($"Didn't send {packetType} to {Id} because they weren't connected yet"); return; } + if (packetType is not PacketType.Cap and not PacketType.Player) + Logger.Info($"About to receive {packetType}"); + int packetSize = MemoryMarshal.Read(data.Span[18..]); await Socket!.SendAsync(data[..(Constants.HeaderSize + packetSize)], SocketFlags.None); }