From 2100da2a9fc61239911f7246c594675ad5b2746e Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 5 Jan 2014 17:06:07 +0000 Subject: [PATCH] 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. --- .../src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java index ee4a3350..1f19286a 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/LegacyDecoder.java @@ -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 ); }