From 6f3397f76f9d25664dda8a078f4cba3133b81bc0 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 3 Aug 2018 17:49:35 -0400 Subject: [PATCH] Adjustments. --- .../velocitypowered/proxy/config/VelocityConfiguration.java | 3 +++ .../proxy/connection/client/LoginSessionHandler.java | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java index d128bc89b..5e3959246 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java @@ -179,6 +179,9 @@ public class VelocityConfiguration { ", ipForwardingMode=" + ipForwardingMode + ", servers=" + servers + ", attemptConnectionOrder=" + attemptConnectionOrder + + ", compressionThreshold=" + compressionThreshold + + ", compressionLevel=" + compressionLevel + + ", motdAsComponent=" + motdAsComponent + '}'; } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java index b4437e535..cb182d8af 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/LoginSessionHandler.java @@ -126,8 +126,10 @@ public class LoginSessionHandler implements MinecraftSessionHandler { } int threshold = VelocityServer.getServer().getConfiguration().getCompressionThreshold(); - inbound.write(new SetCompression(threshold)); - inbound.setCompressionThreshold(threshold); + if (threshold >= 0) { + inbound.write(new SetCompression(threshold)); + inbound.setCompressionThreshold(threshold); + } ServerLoginSuccess success = new ServerLoginSuccess(); success.setUsername(profile.getName());