mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
20 lines
1.8 KiB
Diff
20 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
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 17f01fa589cb7c4eff4233a27e60a5928cbd604d..1cdcb62ead4b9f2e88f1e282813d990ddf2297a5 100644
|
|
--- a/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerHandshakePacketListenerImpl.java
|
|
@@ -51,7 +51,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;
|