mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix packet compression
This commit is contained in:
parent
7ba0c3c8fc
commit
c85352f819
2 changed files with 10 additions and 13 deletions
|
|
@ -1421,12 +1421,10 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
|
||||
if (compression_treshold > 0) //Compression enabled?
|
||||
{
|
||||
if (the_packet.Length > compression_treshold) //Packet long enough for compressing?
|
||||
if (the_packet.Length >= compression_treshold) //Packet long enough for compressing?
|
||||
{
|
||||
byte[] uncompressed_length = getVarInt(the_packet.Length);
|
||||
byte[] compressed_packet = ZlibUtils.Compress(the_packet);
|
||||
byte[] compressed_packet_length = getVarInt(compressed_packet.Length);
|
||||
the_packet = concatBytes(compressed_packet_length, compressed_packet);
|
||||
the_packet = concatBytes(getVarInt(the_packet.Length), compressed_packet);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue