2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-10-02 09:00:16 +00: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
|
2021-02-26 17:54:48 +00:00
|
|
|
index 62621562137cba4804f0465c58d25ca2786328e5..7178b37f7978c7e9031a22726005c5099fd78fe0 100644
|
2018-10-02 09:00:16 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2021-02-26 17:54:48 +00:00
|
|
|
@@ -281,6 +281,11 @@ public class PaperConfig {
|
2018-10-02 09:00:16 +00: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-09 00:09:37 +00:00
|
|
|
private static void savePlayerData() {
|
2020-11-09 01:05:27 +00:00
|
|
|
Object val = config.get("settings.save-player-data");
|
|
|
|
if (val instanceof Boolean) {
|
2018-10-02 09:00:16 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java
|
2021-01-02 04:59:30 +00:00
|
|
|
index 6d9080abb63a6d13d1184ff6949ba86a470ea390..471826ee4b32fe73d3c39755005e3287f9673c3c 100644
|
2018-10-02 09:00:16 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/HandshakeListener.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/HandshakeListener.java
|
2020-11-03 02:22:15 +00:00
|
|
|
@@ -35,7 +35,7 @@ public class HandshakeListener implements PacketHandshakingInListener {
|
2019-05-27 23:01:45 +00: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 02:22:15 +00: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 14:09:55 +00:00
|
|
|
this.c.sendPacket(new PacketLoginOutDisconnect(chatmessage));
|
|
|
|
this.c.close(chatmessage);
|
2019-05-27 23:01:45 +00:00
|
|
|
return;
|