3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-25 15:50:19 +01:00

Fix compression support

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-07-27 01:09:49 -04:00
Ursprung fc5b0d3577
Commit 22c7769eae
2 geänderte Dateien mit 2 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -148,8 +148,6 @@ public class MinecraftConnection extends ChannelInboundHandlerAdapter {
} }
public void setCompressionThreshold(int threshold) { public void setCompressionThreshold(int threshold) {
channel.writeAndFlush(new SetCompression(threshold), channel.voidPromise());
if (threshold == -1) { if (threshold == -1) {
channel.pipeline().remove("compress-decoder"); channel.pipeline().remove("compress-decoder");
channel.pipeline().remove("compress-encoder"); channel.pipeline().remove("compress-encoder");

Datei anzeigen

@ -4,10 +4,7 @@ import com.google.common.base.Preconditions;
import com.velocitypowered.proxy.data.GameProfile; import com.velocitypowered.proxy.data.GameProfile;
import com.velocitypowered.proxy.protocol.MinecraftPacket; import com.velocitypowered.proxy.protocol.MinecraftPacket;
import com.velocitypowered.proxy.protocol.StateRegistry; import com.velocitypowered.proxy.protocol.StateRegistry;
import com.velocitypowered.proxy.protocol.packets.EncryptionRequest; import com.velocitypowered.proxy.protocol.packets.*;
import com.velocitypowered.proxy.protocol.packets.EncryptionResponse;
import com.velocitypowered.proxy.protocol.packets.ServerLogin;
import com.velocitypowered.proxy.protocol.packets.ServerLoginSuccess;
import com.velocitypowered.proxy.connection.MinecraftConnection; import com.velocitypowered.proxy.connection.MinecraftConnection;
import com.velocitypowered.proxy.connection.MinecraftSessionHandler; import com.velocitypowered.proxy.connection.MinecraftSessionHandler;
import com.velocitypowered.proxy.VelocityServer; import com.velocitypowered.proxy.VelocityServer;
@ -93,6 +90,7 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
} }
private void handleSuccessfulLogin(GameProfile profile) { private void handleSuccessfulLogin(GameProfile profile) {
inbound.write(new SetCompression(256));
inbound.setCompressionThreshold(256); inbound.setCompressionThreshold(256);
ServerLoginSuccess success = new ServerLoginSuccess(); ServerLoginSuccess success = new ServerLoginSuccess();