diff options
Diffstat (limited to 'patches/server/0251-Configurable-connection-throttle-kick-message.patch')
-rw-r--r-- | patches/server/0251-Configurable-connection-throttle-kick-message.patch | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/patches/server/0251-Configurable-connection-throttle-kick-message.patch b/patches/server/0251-Configurable-connection-throttle-kick-message.patch new file mode 100644 index 0000000000..ed8fbcb06d --- /dev/null +++ b/patches/server/0251-Configurable-connection-throttle-kick-message.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder <[email protected]> +Date: Tue, 2 Oct 2018 09:57:50 +0100 +Subject: [PATCH] Configurable connection throttle kick message + + +diff --git a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +index 582bbb376c75ab5bf737f3015ce8ad453746e279..946b423d2184f903dc29c923d7dbe05aaa469c09 100644 +--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java ++++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java +@@ -87,7 +87,7 @@ public class ServerHandshakePacketListenerImpl implements ServerHandshakePacketL + synchronized (ServerHandshakePacketListenerImpl.throttleTracker) { + if (ServerHandshakePacketListenerImpl.throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - ServerHandshakePacketListenerImpl.throttleTracker.get(address) < connectionThrottle) { + ServerHandshakePacketListenerImpl.throttleTracker.put(address, currentTime); +- MutableComponent chatmessage = Component.literal("Connection throttled! Please wait before reconnecting."); ++ Component chatmessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(io.papermc.paper.configuration.GlobalConfiguration.get().messages.kick.connectionThrottle); // Paper - Configurable connection throttle kick message + this.connection.send(new ClientboundLoginDisconnectPacket(chatmessage)); + this.connection.disconnect(chatmessage); + return; |