Exemplo n.º 1
0
        public override IByteBuffer WriteHeader(IByteBuffer header, PacketRegistration packet, IByteBuffer data)
        {
            IByteBuffer opcodeBuffer = Unpooled.Buffer(5);

            ByteBufUtils.WriteVarInt(opcodeBuffer, packet.Opcode);
            ByteBufUtils.WriteVarInt(header, opcodeBuffer.ReadableBytes + data.ReadableBytes);
            opcodeBuffer.Release();
            ByteBufUtils.WriteVarInt(header, packet.Opcode);
            return(header);
        }