#3527: Switching between servers causes a decoding error
This commit is contained in:
@@ -31,12 +31,12 @@ public class LegacyDecoder extends ByteToMessageDecoder
|
||||
|
||||
if ( packetID == 0xFE )
|
||||
{
|
||||
out.add( new PacketWrapper( new LegacyPing( in.isReadable() && in.readUnsignedByte() == 0x01 ), Unpooled.EMPTY_BUFFER ) );
|
||||
out.add( new PacketWrapper( new LegacyPing( in.isReadable() && in.readUnsignedByte() == 0x01 ), Unpooled.EMPTY_BUFFER, Protocol.STATUS ) );
|
||||
return;
|
||||
} else if ( packetID == 0x02 && in.isReadable() )
|
||||
{
|
||||
in.skipBytes( in.readableBytes() );
|
||||
out.add( new PacketWrapper( new LegacyHandshake(), Unpooled.EMPTY_BUFFER ) );
|
||||
out.add( new PacketWrapper( new LegacyHandshake(), Unpooled.EMPTY_BUFFER, Protocol.STATUS ) );
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -50,7 +50,7 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf>
|
||||
in.skipBytes( in.readableBytes() );
|
||||
}
|
||||
|
||||
out.add( new PacketWrapper( packet, slice ) );
|
||||
out.add( new PacketWrapper( packet, slice, protocol ) );
|
||||
slice = null;
|
||||
} finally
|
||||
{
|
||||
|
@@ -10,6 +10,7 @@ public class PacketWrapper
|
||||
|
||||
public final DefinedPacket packet;
|
||||
public final ByteBuf buf;
|
||||
public final Protocol protocol;
|
||||
@Setter
|
||||
private boolean released;
|
||||
|
||||
|
Reference in New Issue
Block a user