mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Kick pre-1.19.30 players for not sending a RequestNetworkSettingsPacket
This commit is contained in:
parent
53d002656f
commit
3ec0d82d46
1 changed files with 7 additions and 0 deletions
|
@ -69,6 +69,7 @@ import java.util.OptionalInt;
|
||||||
|
|
||||||
public class UpstreamPacketHandler extends LoggingPacketHandler {
|
public class UpstreamPacketHandler extends LoggingPacketHandler {
|
||||||
|
|
||||||
|
private boolean networkSettingsRequested = false;
|
||||||
private Deque<String> packsToSent = new ArrayDeque<>();
|
private Deque<String> packsToSent = new ArrayDeque<>();
|
||||||
|
|
||||||
public UpstreamPacketHandler(GeyserImpl geyser, GeyserSession session) {
|
public UpstreamPacketHandler(GeyserImpl geyser, GeyserSession session) {
|
||||||
|
@ -137,6 +138,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
||||||
|
|
||||||
session.getUpstream().getSession().setCompression(algorithm);
|
session.getUpstream().getSession().setCompression(algorithm);
|
||||||
session.getUpstream().getSession().setCompressionLevel(this.geyser.getConfig().getBedrock().getCompressionLevel());
|
session.getUpstream().getSession().setCompressionLevel(this.geyser.getConfig().getBedrock().getCompressionLevel());
|
||||||
|
networkSettingsRequested = true;
|
||||||
return PacketSignal.HANDLED;
|
return PacketSignal.HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -148,6 +150,11 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
|
||||||
return PacketSignal.HANDLED;
|
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
|
// Set the block translation based off of version
|
||||||
session.setBlockMappings(BlockRegistries.BLOCKS.forVersion(loginPacket.getProtocolVersion()));
|
session.setBlockMappings(BlockRegistries.BLOCKS.forVersion(loginPacket.getProtocolVersion()));
|
||||||
session.setItemMappings(Registries.ITEMS.forVersion(loginPacket.getProtocolVersion()));
|
session.setItemMappings(Registries.ITEMS.forVersion(loginPacket.getProtocolVersion()));
|
||||||
|
|
Loading…
Reference in a new issue