aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0251-Configurable-connection-throttle-kick-message.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2024-06-13 12:04:27 -0700
committerJake Potrebic <[email protected]>2024-06-13 12:04:27 -0700
commitec05cb8b38e5af408e4f46071ebbcad351be4d88 (patch)
tree50c345ce6c34f2c07a546dda8d21edd44896a905 /patches/server/0251-Configurable-connection-throttle-kick-message.patch
parent0b7552272a36e51dc08e8ba731759d0a9a421140 (diff)
downloadPaper-ec05cb8b38e5af408e4f46071ebbcad351be4d88.tar.gz
Paper-ec05cb8b38e5af408e4f46071ebbcad351be4d88.zip
279
Diffstat (limited to 'patches/server/0251-Configurable-connection-throttle-kick-message.patch')
-rw-r--r--patches/server/0251-Configurable-connection-throttle-kick-message.patch19
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;