Set up packet codec and channel initialization

This commit is contained in:
P0nk
2021-06-22 20:32:35 +02:00
parent 171215e653
commit 5431150362
7 changed files with 17 additions and 10 deletions

View File

@@ -19,7 +19,7 @@ public class PacketDecoder extends ReplayingDecoder<Void> {
protected void decode(ChannelHandlerContext context, ByteBuf in, List<Object> out) {
final int header = in.readInt();
if (!receiveCypher.checkPacket(header)) {
if (!receiveCypher.isValidHeader(header)) {
throw new InvalidPacketHeaderException("Attempted to decode a packet with an invalid header", header);
}