mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-22 11:15:15 +00:00
More logs
This commit is contained in:
parent
726bb45a00
commit
497ebcc06b
1 changed files with 5 additions and 1 deletions
|
@ -37,9 +37,13 @@ public class Client : IDisposable {
|
||||||
|
|
||||||
public async Task Send<T>(T packet, Client? sender = null) where T : struct, IPacket {
|
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);
|
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 {
|
PacketHeader header = new PacketHeader {
|
||||||
Id = sender?.Id ?? Id,
|
Id = sender?.Id ?? Id,
|
||||||
Type = Constants.PacketMap[typeof(T)].Type,
|
Type = packetAttribute.Type,
|
||||||
PacketSize = packet.Size
|
PacketSize = packet.Size
|
||||||
};
|
};
|
||||||
Server.FillPacket(header, packet, memory.Memory);
|
Server.FillPacket(header, packet, memory.Memory);
|
||||||
|
|
Loading…
Reference in a new issue