0
0
Fork 0
mirror of https://github.com/Sanae6/SmoOnlineServer.git synced 2024-11-25 04:35:18 +00:00

More logs

This commit is contained in:
Sanae 2022-04-26 23:48:13 -06:00
parent 726bb45a00
commit 497ebcc06b

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);