From b057f14f179610e03e034e5038834fbcbfd6b985 Mon Sep 17 00:00:00 2001 From: Bixilon Date: Thu, 20 Aug 2020 15:22:13 +0200 Subject: [PATCH] re enable compression --- .../de/bixilon/minosoft/protocol/network/Network.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main/java/de/bixilon/minosoft/protocol/network/Network.java b/src/main/java/de/bixilon/minosoft/protocol/network/Network.java index 8b989cd8a..0af97554f 100644 --- a/src/main/java/de/bixilon/minosoft/protocol/network/Network.java +++ b/src/main/java/de/bixilon/minosoft/protocol/network/Network.java @@ -176,17 +176,13 @@ public class Network { continue; } + //set special settings to avoid miss timing issues if (packetInstance instanceof PacketLoginSuccess) { - // login was okay, setting play status to avoid miss timing issues connection.setConnectionState(ConnectionState.PLAY); } else if (packetInstance instanceof PacketLoginSetCompression) { - // instantly set compression. because handling is to slow... - // compressionThreshold = ((PacketLoginSetCompression) packet).getThreshold(); - compressionThreshold = Integer.MAX_VALUE; // FIXME: 29.07.20 see #2 + compressionThreshold = ((PacketLoginSetCompression) packetInstance).getThreshold(); } else if (packetInstance instanceof PacketSetCompression) { - // instantly set compression. because handling is to slow... - // compressionThreshold = ((PacketSetCompression) packet).getThreshold(); - compressionThreshold = Integer.MAX_VALUE; // FIXME: 29.07.20 see #2 + compressionThreshold = ((PacketSetCompression) packetInstance).getThreshold(); } connection.handle(packetInstance); } catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {