Update the PluginMessage packet to respect the protocol limit changes in 1.8
This commit is contained in:
parent
81d1c46a0d
commit
6343416c0c
@ -1,5 +1,6 @@
|
|||||||
package net.md_5.bungee.protocol.packet;
|
package net.md_5.bungee.protocol.packet;
|
||||||
|
|
||||||
|
import com.google.common.base.Preconditions;
|
||||||
import net.md_5.bungee.protocol.DefinedPacket;
|
import net.md_5.bungee.protocol.DefinedPacket;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
@ -38,6 +39,8 @@ public class PluginMessage extends DefinedPacket
|
|||||||
data = readArrayLegacy( buf );
|
data = readArrayLegacy( buf );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
int maxSize = direction == ProtocolConstants.Direction.TO_SERVER ? Short.MAX_VALUE : 0x100000;
|
||||||
|
Preconditions.checkArgument(buf.readableBytes() < maxSize);
|
||||||
data = new byte[ buf.readableBytes() ];
|
data = new byte[ buf.readableBytes() ];
|
||||||
buf.readBytes( data );
|
buf.readBytes( data );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user