2019-07-20 06:01:24 +02:00
|
|
|
From 3e8591beff5e88eda41d6790603446fbe00fe15c Mon Sep 17 00:00:00 2001
|
2017-08-18 01:13:22 +02: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
|
2019-07-20 06:01:24 +02:00
|
|
|
index 11d2a1013b..11f08c2b73 100644
|
2017-08-18 01:13:22 +02: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;
|
2019-05-06 09:20:16 +02:00
|
|
|
@@ -264,4 +265,9 @@ public class PaperConfig {
|
2017-08-18 01:13:22 +02: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
|
2019-07-20 06:01:24 +02:00
|
|
|
index 977a5009dd..c3ff7a6b8f 100644
|
2017-08-18 01:13:22 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
2019-07-20 06:01:24 +02:00
|
|
|
@@ -247,6 +247,10 @@ public class LoginListener implements PacketLoginInListener {
|
2017-08-18 01:13:22 +02:00
|
|
|
LoginListener.this.i = LoginListener.this.a(gameprofile);
|
|
|
|
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
|
|
|
|
} else {
|
|
|
|
+ // Paper start
|
|
|
|
+ if (com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage != null) {
|
|
|
|
+ LoginListener.this.disconnect(new ChatComponentText(com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage));
|
|
|
|
+ } else // Paper end
|
|
|
|
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down", new Object[0]));
|
2019-04-28 01:23:53 +02:00
|
|
|
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
|
2017-08-18 01:13:22 +02:00
|
|
|
}
|
|
|
|
--
|
2019-06-25 21:18:50 +02:00
|
|
|
2.22.0
|
2017-08-18 01:13:22 +02:00
|
|
|
|