1package com.runehive.net.codec.game;
3import com.runehive.net.packet.GamePacket;
4import com.runehive.net.packet.PacketType;
5import com.runehive.net.codec.IsaacCipher;
6import io.netty.buffer.ByteBuf;
7import io.netty.channel.ChannelHandlerContext;
8import io.netty.handler.codec.MessageToByteEncoder;
20 out.writeByte((
packet.getOpcode() + (
encryptor.getKey() & 0xFF)) & 0xFF);
22 out.writeByte(
packet.getSize());
24 out.writeShort(
packet.getSize());
26 out.writeBytes(
packet.getPayload());
An implementation of an ISAAC cipher.
void encode(ChannelHandlerContext ctx, GamePacket packet, ByteBuf out)
final IsaacCipher encryptor
GamePacketEncoder(IsaacCipher encryptor)
Represents a single game packet.
Represents a type of packet.
VAR_SHORT
A variable packet where the size is indicated by a short.
VAR_BYTE
A variable packet where the size is indicated by a byte.