2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2017-08-17 23:13:22 +00:00
|
|
|
From: kashike <kashike@vq.lc>
|
|
|
|
Date: Thu, 17 Aug 2017 16:08:20 -0700
|
|
|
|
Subject: [PATCH] Allow specifying a custom "authentication servers down" kick
|
|
|
|
message
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
2021-01-02 04:59:30 +00:00
|
|
|
index ed519159c37299595b4eaeaab5131a8ec3d9d27e..cedc8c45224fe991a2ec8dd2ed435edadd556be9 100644
|
2017-08-17 23:13:22 +00:00
|
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
|
|
@@ -1,5 +1,6 @@
|
|
|
|
package com.destroystokyo.paper;
|
|
|
|
|
|
|
|
+import com.google.common.base.Strings;
|
|
|
|
import com.google.common.base.Throwables;
|
|
|
|
|
|
|
|
import java.io.File;
|
2021-01-02 04:59:30 +00:00
|
|
|
@@ -268,4 +269,9 @@ public class PaperConfig {
|
2017-08-17 23:13:22 +00:00
|
|
|
private static void suggestPlayersWhenNull() {
|
|
|
|
suggestPlayersWhenNullTabCompletions = getBoolean("settings.suggest-player-names-when-null-tab-completions", suggestPlayersWhenNullTabCompletions);
|
|
|
|
}
|
|
|
|
+
|
|
|
|
+ public static String authenticationServersDownKickMessage = ""; // empty = use translatable message
|
|
|
|
+ private static void authenticationServersDownKickMessage() {
|
|
|
|
+ authenticationServersDownKickMessage = Strings.emptyToNull(getString("messages.kick.authentication-servers-down", authenticationServersDownKickMessage));
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java
|
2021-02-21 19:45:33 +00:00
|
|
|
index a7b57185d337846d8f7b296b31665315d375ecd5..a8f155b7149d5702896375c7cae1c8c573543060 100644
|
2017-08-17 23:13:22 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
2021-02-21 19:45:33 +00:00
|
|
|
@@ -258,6 +258,10 @@ public class LoginListener implements PacketLoginInListener {
|
2020-11-03 02:22:15 +00:00
|
|
|
LoginListener.this.i = LoginListener.this.a(gameprofile);
|
|
|
|
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
|
|
|
|
} else {
|
2017-08-17 23:13:22 +00:00
|
|
|
+ // Paper start
|
|
|
|
+ if (com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage != null) {
|
|
|
|
+ LoginListener.this.disconnect(new ChatComponentText(com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage));
|
|
|
|
+ } else // Paper end
|
2020-11-03 02:22:15 +00:00
|
|
|
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down"));
|
|
|
|
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
|
|
|
|
}
|