diff --git a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java index 27d9cf40e..4ecb7a4e2 100644 --- a/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java +++ b/protocol/src/main/java/net/md_5/bungee/protocol/MinecraftDecoder.java @@ -20,7 +20,7 @@ public class MinecraftDecoder extends ByteToMessageDecoder protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { Protocol.ProtocolDirection prot = ( server ) ? protocol.TO_SERVER : protocol.TO_CLIENT; - ByteBuf copy = in.copy(); + ByteBuf copy = in.copy(); // TODO int packetId = DefinedPacket.readVarInt( in ); @@ -32,7 +32,7 @@ public class MinecraftDecoder extends ByteToMessageDecoder if ( in.readableBytes() != 0 ) { System.out.println( in.toString( Charsets.UTF_8 ) ); - throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot ); + // throw new BadPacketException( "Did not read all bytes from packet " + packet.getClass() + " " + packetId + " Protocol " + protocol + " Direction " + prot ); } } diff --git a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java index e971e1ac0..f29ecf1c8 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/InitialHandler.java @@ -332,7 +332,7 @@ public class InitialHandler extends PacketHandler implements PendingConnection try { Cipher encrypt = EncryptionUtil.getCipher( Cipher.ENCRYPT_MODE, sharedKey ); - ch.addBefore( PipelineUtils.DECRYPT_HANDLER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) ); + ch.addBefore( PipelineUtils.FRAME_PREPENDER, PipelineUtils.ENCRYPT_HANDLER, new CipherEncoder( encrypt ) ); } catch ( GeneralSecurityException ex ) { disconnect( "Cipher error: " + Util.exception( ex ) );