2022-05-07 23:59:20 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
Date: Sat, 7 May 2022 14:58:53 -0700
|
|
|
|
Subject: [PATCH] Do not accept invalid client settings
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2023-04-09 20:38:32 +02:00
|
|
|
index 8d9a3c7a66895966aade2626c828f8cbcdd32380..f295110637682c2b4064682e456264e017b512e3 100644
|
2022-05-07 23:59:20 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
2023-04-09 20:38:32 +02:00
|
|
|
@@ -3480,6 +3480,13 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
|
2022-05-07 23:59:20 +02:00
|
|
|
@Override
|
|
|
|
public void handleClientInformation(ServerboundClientInformationPacket packet) {
|
|
|
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.getLevel());
|
|
|
|
+ // Paper start - do not accept invalid information
|
|
|
|
+ if (packet.viewDistance() < 0) {
|
|
|
|
+ LOGGER.warn("Disconnecting " + this.player.getScoreboardName() + " for invalid view distance: " + packet.viewDistance());
|
|
|
|
+ this.disconnect("Invalid client settings", PlayerKickEvent.Cause.ILLEGAL_ACTION);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ // Paper end - do not accept invalid information
|
|
|
|
this.player.updateOptions(packet);
|
|
|
|
}
|
|
|
|
|