Don't remove the legacy decoder if a legacy packet is found
Removing the decoder causes the bytebuf to be passed on to the next handler to be parsed normal packet which causes an error with legacy handshakes.
This commit is contained in:
parent
986f52b1e1
commit
2100da2a9f
@ -26,10 +26,12 @@ public class LegacyDecoder extends ByteToMessageDecoder
|
||||
if ( b1 == 0xFE && b2 == 0x01 && b3 == 0xFA )
|
||||
{
|
||||
out.add( new PacketWrapper( new LegacyPing(), Unpooled.EMPTY_BUFFER ) );
|
||||
return;
|
||||
}
|
||||
if ( b1 == 0x02 && b2 >= 60 && b2 <= 78 )
|
||||
{
|
||||
out.add( new PacketWrapper( new LegacyHandshake(), Unpooled.EMPTY_BUFFER ) );
|
||||
return;
|
||||
}
|
||||
ctx.pipeline().remove( this );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user