File tree Expand file tree Collapse file tree
src/main/java/com/viaversion/aas/codec Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .viaversion .aas .codec ;
22
33import com .viaversion .aas .UtilKt ;
4- import com .viaversion .viaversion .api .type .Type ;
54import com .viaversion .viaversion .api .type .Types ;
6- import com .viaversion .viaversion .exception .CancelDecoderException ;
75import io .netty .buffer .ByteBuf ;
86import io .netty .channel .ChannelHandlerContext ;
97import io .netty .handler .codec .ByteToMessageCodec ;
@@ -15,9 +13,8 @@ public class FrameCodec extends ByteToMessageCodec<ByteBuf> {
1513 @ Override
1614 protected void decode (ChannelHandlerContext ctx , ByteBuf in , List <Object > out ) throws Exception {
1715 if (!ctx .channel ().isActive ()) {
18- in .clear ();
19- // Netty throws an exception when there's no output
20- throw CancelDecoderException .CACHED ;
16+ in .readerIndex (in .writerIndex ());
17+ return ;
2118 }
2219 // Ignore, should prevent DoS https://github.com/SpigotMC/BungeeCord/pull/2908
2320
Original file line number Diff line number Diff line change 77import com .viaversion .aas .util .StacklessException ;
88import com .viaversion .viaversion .api .protocol .packet .Direction ;
99import com .viaversion .viaversion .api .protocol .version .ProtocolVersion ;
10- import com .viaversion .viaversion .exception .CancelEncoderException ;
1110import io .netty .buffer .ByteBuf ;
1211import io .netty .buffer .ByteBufAllocator ;
1312import io .netty .channel .ChannelHandlerContext ;
1918public class MinecraftCodec extends MessageToMessageCodec <ByteBuf , Packet > {
2019 @ Override
2120 protected void encode (@ NotNull ChannelHandlerContext ctx , @ NotNull Packet msg , @ NotNull List <Object > out ) {
22- if (!ctx .channel ().isActive ()) throw CancelEncoderException .generate (null );
23-
2421 var buf = ByteBufAllocator .DEFAULT .buffer ();
2522
2623 try {
You can’t perform that action at this time.
0 commit comments