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
|
2020-06-26 06:29:44 +00:00
|
|
|
index 5fa63d7ca20b88a44d8800b3ebf74e4c0e376d0b..cee8740e644c492e3d71fd58791e7d52d57e856d 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;
|
2020-06-26 06:29:44 +00:00
|
|
|
@@ -265,4 +266,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
|
2020-08-25 02:22:08 +00:00
|
|
|
index a9ec9f123f94df2368347ef9e6673cfb80186cf4..e7e2566a019441b9b95ae5f38c75134e451f227f 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
|
2020-06-25 13:11:48 +00:00
|
|
|
@@ -246,6 +246,10 @@ public class LoginListener implements PacketLoginInListener {
|
2017-08-17 23:13:22 +00: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
|
2020-06-25 13:11:48 +00:00
|
|
|
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down"));
|
2019-04-27 23:23:53 +00:00
|
|
|
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
|
2017-08-17 23:13:22 +00:00
|
|
|
}
|