Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Fix compression support
Dieser Commit ist enthalten in:
Ursprung
fc5b0d3577
Commit
22c7769eae
@ -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");
|
||||||
|
@ -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();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren