2018-07-24 08:24:44 +08:00
|
|
|
From 0b0a3e748bda1f720b5c63af9d9175550f43232f Mon Sep 17 00:00:00 2001
|
2017-08-18 07:13:22 +08: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
|
2018-07-24 08:24:44 +08:00
|
|
|
index 329950802..7a2c70302 100644
|
2017-08-18 07:13:22 +08: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;
|
2018-07-24 08:24:44 +08:00
|
|
|
@@ -280,4 +281,9 @@ public class PaperConfig {
|
2017-08-18 07:13:22 +08: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
|
2018-07-24 08:24:44 +08:00
|
|
|
index 85eff6e2d..3464af679 100644
|
2017-08-18 07:13:22 +08:00
|
|
|
--- a/src/main/java/net/minecraft/server/LoginListener.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/LoginListener.java
|
2018-07-18 08:08:13 +08:00
|
|
|
@@ -241,6 +241,10 @@ public class LoginListener implements PacketLoginInListener, ITickable {
|
2017-08-18 07:13:22 +08: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]));
|
|
|
|
LoginListener.c.error("Couldn\'t verify username because servers are unavailable");
|
|
|
|
}
|
|
|
|
--
|
2018-07-04 15:55:24 +08:00
|
|
|
2.18.0
|
2017-08-18 07:13:22 +08:00
|
|
|
|