Put more logs around send
This commit is contained in:
parent
4fb57f9b7e
commit
6288f8ae49
|
@ -38,15 +38,18 @@ public class Client : IDisposable {
|
||||||
IMemoryOwner<byte> memory = MemoryPool<byte>.Shared.RentZero(Constants.HeaderSize + packet.Size);
|
IMemoryOwner<byte> memory = MemoryPool<byte>.Shared.RentZero(Constants.HeaderSize + packet.Size);
|
||||||
|
|
||||||
PacketAttribute packetAttribute = Constants.PacketMap[typeof(T)];
|
PacketAttribute packetAttribute = Constants.PacketMap[typeof(T)];
|
||||||
if (packetAttribute.Type is not PacketType.Cap and not PacketType.Player)
|
|
||||||
Logger.Info($"About to receive {packetAttribute.Type} ({(short)packetAttribute.Type}) - {typeof(T)}");
|
|
||||||
PacketHeader header = new PacketHeader {
|
PacketHeader header = new PacketHeader {
|
||||||
Id = sender?.Id ?? Id,
|
Id = sender?.Id ?? Id,
|
||||||
Type = packetAttribute.Type,
|
Type = packetAttribute.Type,
|
||||||
PacketSize = packet.Size
|
PacketSize = packet.Size
|
||||||
};
|
};
|
||||||
Server.FillPacket(header, packet, memory.Memory);
|
Server.FillPacket(header, packet, memory.Memory);
|
||||||
await Send(memory.Memory, sender, packetAttribute.Type);
|
|
||||||
|
if (packetAttribute.Type is not PacketType.Cap and not PacketType.Player)
|
||||||
|
Logger.Info($"About to receive {packetAttribute.Type} ({(short)packetAttribute.Type}) - {typeof(T)}");
|
||||||
|
await Socket!.SendAsync(memory.Memory[..(Constants.HeaderSize + packet.Size)], SocketFlags.None);
|
||||||
|
if (packetAttribute.Type is not PacketType.Cap and not PacketType.Player)
|
||||||
|
Logger.Info($"Receiving {packetAttribute.Type} ({(short)packetAttribute.Type}) - {typeof(T)}");
|
||||||
memory.Dispose();
|
memory.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue