Skip to content

Commit ac5af38

Browse files
authored
Fix Can't join: ByteToMessageCodec$1.decode() did not read anything but decoded a message (#893)
1 parent 290d84c commit ac5af38

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

protocol/src/main/java/org/geysermc/mcprotocollib/network/netty/PacketEncryptorCodec.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) t
4747
try {
4848
config.encryption().decrypt(heapBuf.array(), baseOffset, inBytes, heapBuf.array(), baseOffset);
4949
out.add(heapBuf);
50+
if (in.hasArray()) in.readerIndex(inBytes); // This is required as otherwise the ByteBuf doesn't know it has been read
5051
} catch (Exception e) {
5152
heapBuf.release();
5253
throw e;

0 commit comments

Comments
 (0)