Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-20 06:50:09 +01:00
Kick pre-1.19.30 players for not sending a RequestNetworkSettingsPacket
Dieser Commit ist enthalten in:
Ursprung
53d002656f
Commit
3ec0d82d46
@ -69,6 +69,7 @@ import java.util.OptionalInt;
|
||||
|
||||
public class UpstreamPacketHandler extends LoggingPacketHandler {
|
||||
|
||||
private boolean networkSettingsRequested = false;
|
||||
private Deque<String> packsToSent = new ArrayDeque<>();
|
||||
|
||||
public UpstreamPacketHandler(GeyserImpl geyser, GeyserSession session) {
|
||||
@ -137,6 +138,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
||||
|
||||
session.getUpstream().getSession().setCompression(algorithm);
|
||||
session.getUpstream().getSession().setCompressionLevel(this.geyser.getConfig().getBedrock().getCompressionLevel());
|
||||
networkSettingsRequested = true;
|
||||
return PacketSignal.HANDLED;
|
||||
}
|
||||
|
||||
@ -148,6 +150,11 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
||||
return PacketSignal.HANDLED;
|
||||
}
|
||||
|
||||
if (!networkSettingsRequested) {
|
||||
session.disconnect(GeyserLocale.getLocaleStringLog("geyser.network.outdated.client", GameProtocol.getAllSupportedBedrockVersions()));
|
||||
return PacketSignal.HANDLED;
|
||||
}
|
||||
|
||||
// Set the block translation based off of version
|
||||
session.setBlockMappings(BlockRegistries.BLOCKS.forVersion(loginPacket.getProtocolVersion()));
|
||||
session.setItemMappings(Registries.ITEMS.forVersion(loginPacket.getProtocolVersion()));
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren