This repository has been archived on 2024-03-29. You can view files and clone it, but cannot push or open issues or pull requests.
FreeSR/FreeSR.Gateserver/Network/Handlers/Encoder/PacketEncoder.cs

20 lines
619 B
C#
Raw Normal View History

2024-01-27 13:06:07 +00:00
namespace FreeSR.Gateserver.Network.Handlers.Encoder
{
using DotNetty.Buffers;
using DotNetty.Codecs;
using DotNetty.Transport.Channels;
using FreeSR.Gateserver.Network.Packet;
using NLog;
internal class PacketEncoder : MessageToByteEncoder<NetPacket>
{
private static readonly Logger s_log = LogManager.GetCurrentClassLogger();
protected override void Encode(IChannelHandlerContext context, NetPacket message, IByteBuffer output)
{
output.WriteBytes(message.Buf);
s_log.Info($"Sent packet with cmdId {message.CmdId}");
}
}
}