mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-24 17:47:41 +01:00
Apply stricter length limits to client strings
Also bump snapshot version and remove redundant file header
This commit is contained in:
parent
5823f47467
commit
e5ded9a2fb
@ -34,7 +34,7 @@ public class ProtocolConstants
|
||||
public static final int MINECRAFT_1_16_2 = 751;
|
||||
public static final int MINECRAFT_1_16_3 = 753;
|
||||
public static final int MINECRAFT_1_16_4 = 754;
|
||||
public static final int MINECRAFT_1_17 = 1073741851;
|
||||
public static final int MINECRAFT_1_17 = 1073741852;
|
||||
public static final List<String> SUPPORTED_VERSIONS;
|
||||
public static final List<Integer> SUPPORTED_VERSION_IDS;
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class Chat extends DefinedPacket
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
message = readString( buf );
|
||||
message = readString( buf, 256 );
|
||||
if ( direction == ProtocolConstants.Direction.TO_CLIENT )
|
||||
{
|
||||
position = buf.readByte();
|
||||
|
@ -28,7 +28,7 @@ public class ClientSettings extends DefinedPacket
|
||||
@Override
|
||||
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
|
||||
{
|
||||
locale = readString( buf );
|
||||
locale = readString( buf, 16 );
|
||||
viewDistance = buf.readByte();
|
||||
chatFlags = protocolVersion >= ProtocolConstants.MINECRAFT_1_9 ? DefinedPacket.readVarInt( buf ) : buf.readUnsignedByte();
|
||||
chatColours = buf.readBoolean();
|
||||
|
@ -24,7 +24,7 @@ public class Handshake extends DefinedPacket
|
||||
public void read(ByteBuf buf)
|
||||
{
|
||||
protocolVersion = readVarInt( buf );
|
||||
host = readString( buf );
|
||||
host = readString( buf, 255 );
|
||||
port = buf.readUnsignedShort();
|
||||
requestedProtocol = readVarInt( buf );
|
||||
}
|
||||
|
@ -1,7 +1,3 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package net.md_5.bungee.protocol.packet;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
@ -41,7 +41,7 @@ public class TabCompleteRequest extends DefinedPacket
|
||||
{
|
||||
transactionId = readVarInt( buf );
|
||||
}
|
||||
cursor = readString( buf );
|
||||
cursor = readString( buf, 32500 );
|
||||
|
||||
if ( protocolVersion < ProtocolConstants.MINECRAFT_1_13 )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user