2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-02 11:00:16 +02:00
|
|
|
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/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2020-11-08 11:00:43 +01:00
|
|
|
index 6a23438c11d4c758ef718e9575c548152052ff2f..c11b864b667f199f3d73db856399e47ec7e66d6c 100644
|
2018-10-02 11:00:16 +02:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2020-06-26 08:29:44 +02:00
|
|
|
@@ -273,6 +273,11 @@ public class PaperConfig {
|
2018-10-02 11:00:16 +02:00
|
|
|
authenticationServersDownKickMessage = Strings.emptyToNull(getString("messages.kick.authentication-servers-down", authenticationServersDownKickMessage));
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public static String connectionThrottleKickMessage = "Connection throttled! Please wait before reconnecting.";
|
|
|
|
+ private static void connectionThrottleKickMessage() {
|
|
|
|
+ connectionThrottleKickMessage = getString("messages.kick.connection-throttle", connectionThrottleKickMessage);
|
|
|
|
+ }
|
|
|
|
+
|
2020-11-08 11:00:43 +01:00
|
|
|
public static boolean useAlternativeLuckFormula = false;
|
|
|
|
private static void useAlternativeLuckFormula() {
|
|
|
|
useAlternativeLuckFormula = getBoolean("settings.use-alternative-luck-formula", false);
|
2018-10-02 11:00:16 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
|
2020-11-03 03:22:15 +01:00
|
|
|
index abace78271eedd453df692f4e24dacef474d215e..5e1747dc176ef855829a38605ec85c8494fb0d21 100644
|
2018-10-02 11:00:16 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
|
2020-11-03 03:22:15 +01:00
|
|
|
@@ -35,7 +35,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
2019-05-28 01:01:45 +02:00
|
|
|
synchronized (throttleTracker) {
|
|
|
|
if (throttleTracker.containsKey(address) && !"127.0.0.1".equals(address.getHostAddress()) && currentTime - throttleTracker.get(address) < connectionThrottle) {
|
|
|
|
throttleTracker.put(address, currentTime);
|
2020-11-03 03:22:15 +01:00
|
|
|
- ChatMessage chatmessage = new ChatMessage("Connection throttled! Please wait before reconnecting.");
|
|
|
|
+ ChatMessage chatmessage = new ChatMessage(com.destroystokyo.paper.PaperConfig.connectionThrottleKickMessage); // Paper - Configurable connection throttle kick message
|
2020-06-25 16:09:55 +02:00
|
|
|
this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage));
|
|
|
|
this.c.close(chatmessage);
|
2019-05-28 01:01:45 +02:00
|
|
|
return;
|