PaperMC/Spigot-Server-Patches/0205-Allow-specifying-a-custom-authentication-servers-dow.patch
Aikar 05466e3b47
[Auto] Update Upstream
Upstream has released updates that appear to apply compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing.

Bukkit Changes:
d2834556 SPIGOT-4219: Event for PigZombies angering.

CraftBukkit Changes:
a9c796f1 SPIGOT-4184: Fix furnaces not matching Vanilla smelt or animations
195f071e SPIGOT-4219: Event for PigZombies angering.
5e3082c7 SPIGOT-4230: Improve legacy block types
2018-08-05 19:46:43 -04:00

46 lines
2.5 KiB
Diff

From ba56e59de1c80d48ff61b963108ba3031091f2ec Mon Sep 17 00:00:00 2001
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
index e97dbaf8e3..45863c017c 100644
--- 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;
@@ -280,4 +281,9 @@ public class PaperConfig {
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
index 005efbc111..6249b0e686 100644
--- a/src/main/java/net/minecraft/server/LoginListener.java
+++ b/src/main/java/net/minecraft/server/LoginListener.java
@@ -240,6 +240,10 @@ public class LoginListener implements PacketLoginInListener, ITickable {
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");
}
--
2.18.0