Camotoy 2024-01-04 13:49:01 -05:00
parent 46bde0c019
commit 7613bdbafe
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F

View file

@ -28,6 +28,8 @@ package org.geysermc.geyser.network;
import io.netty.buffer.Unpooled;
import org.cloudburstmc.protocol.bedrock.BedrockDisconnectReasons;
import org.cloudburstmc.protocol.bedrock.codec.BedrockCodec;
import org.cloudburstmc.protocol.bedrock.codec.compat.BedrockCompat;
import org.cloudburstmc.protocol.bedrock.codec.v622.Bedrock_v622;
import org.cloudburstmc.protocol.bedrock.data.ExperimentData;
import org.cloudburstmc.protocol.bedrock.data.PacketCompressionAlgorithm;
import org.cloudburstmc.protocol.bedrock.data.ResourcePackType;
@ -108,6 +110,10 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
session.disconnect(disconnectMessage);
return false;
} else if (protocolVersion < GameProtocol.DEFAULT_BEDROCK_CODEC.getProtocolVersion()) {
if (protocolVersion < Bedrock_v622.CODEC.getProtocolVersion()) {
// https://github.com/GeyserMC/Geyser/issues/4378
session.getUpstream().getSession().setCodec(BedrockCompat.CODEC_LEGACY);
}
session.disconnect(GeyserLocale.getLocaleStringLog("geyser.network.outdated.client", supportedVersions));
return false;
} else {