More logs

This commit is contained in:
Sanae 2022-04-26 23:48:13 -06:00
parent 726bb45a00
commit 497ebcc06b
1 changed files with 5 additions and 1 deletions

View File

@ -37,9 +37,13 @@ public class Client : IDisposable {
public async Task Send<T>(T packet, Client? sender = null) where T : struct, IPacket {
IMemoryOwner<byte> memory = MemoryPool<byte>.Shared.RentZero(Constants.HeaderSize + packet.Size);
PacketAttribute packetAttribute = Constants.PacketMap[typeof(T)];
if (packetAttribute.Type is not PacketType.Cap and not PacketType.Player)
Logger.Info($"About to receive {packetAttribute.Type}");
PacketHeader header = new PacketHeader {
Id = sender?.Id ?? Id,
Type = Constants.PacketMap[typeof(T)].Type,
Type = packetAttribute.Type,
PacketSize = packet.Size
};
Server.FillPacket(header, packet, memory.Memory);