2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2021-02-26 18:54:48 +01:00
|
|
|
index 48319aaf1c525c6fb7bdee5c2f570a0d056d4eae..52954fc3bf932cfc9d5ce63e3d3cace351305790 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;
|
2021-02-26 18:54:48 +01:00
|
|
|
@@ -273,4 +274,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));
|
|
|
|
+ }
|
|
|
|
}
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/LoginListener.java b/src/main/java/net/minecraft/server/network/LoginListener.java
|
|
|
|
index 651b84b3bba316407a217c941be4c20074c5bb90..5b96c69014dbfb8eb3e2ecf370ad69f2ffc31453 100644
|
|
|
|
--- a/src/main/java/net/minecraft/server/network/LoginListener.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/LoginListener.java
|
|
|
|
@@ -276,6 +276,10 @@ public class LoginListener implements PacketLoginInListener {
|
2020-11-03 03:22:15 +01:00
|
|
|
LoginListener.this.i = LoginListener.this.a(gameprofile);
|
|
|
|
LoginListener.this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT;
|
|
|
|
} else {
|
2017-08-18 01:13:22 +02: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 03:22:15 +01:00
|
|
|
LoginListener.this.disconnect(new ChatMessage("multiplayer.disconnect.authservers_down"));
|
|
|
|
LoginListener.LOGGER.error("Couldn't verify username because servers are unavailable");
|
|
|
|
}
|