fork from 1.3

This commit is contained in:
moux23333
2024-01-27 21:06:07 +08:00
commit 22fc0b0848
1507 changed files with 24139 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
namespace FreeSR.Gateserver.Network.Handlers.Decoder
{
using DotNetty.Buffers;
using DotNetty.Codecs;
using DotNetty.Transport.Channels;
using FreeSR.Gateserver.Network.Packet;
using NLog;
internal class PacketDecoder : MessageToMessageDecoder<IByteBuffer>
{
private static readonly Logger s_log = LogManager.GetCurrentClassLogger();
protected override void Decode(IChannelHandlerContext context, IByteBuffer message, List<object> output)
{
var netPacket = new NetPacket();
DeserializationResult result;
if ((result = netPacket.Deserialize(message)) != DeserializationResult.SUCC)
{
context.CloseAsync();
s_log.Info("Closing connection, reason: " + result);
return;
}
output.Add(netPacket);
}
}
}