#3715: Fix maximum length for command packets

This commit is contained in:
Nick 2024-07-28 21:07:49 +10:00 committed by md_5
parent 45d2f44003
commit b64615e298
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ public class ClientCommand extends DefinedPacket
@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
command = readString( buf, 256 );
command = readString( buf, ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 ) ? 32767 : 256 );
timestamp = buf.readLong();
salt = buf.readLong();

View File

@ -21,7 +21,7 @@ public class UnsignedClientCommand extends DefinedPacket
@Override
public void read(ByteBuf buf, ProtocolConstants.Direction direction, int protocolVersion)
{
command = readString( buf, 256 );
command = readString( buf, ( protocolVersion >= ProtocolConstants.MINECRAFT_1_20_5 ) ? 32767 : 256 );
}
@Override