From d43da9fc7083e49f628f9a040708d4341534ccea Mon Sep 17 00:00:00 2001 From: kashike Date: Thu, 17 Aug 2017 16:13:22 -0700 Subject: [PATCH] Allow specifying a custom "authentication servers down" kick message Thanks to @phenomax in #855 --- ...-a-custom-authentication-servers-dow.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Spigot-Server-Patches/0234-Allow-specifying-a-custom-authentication-servers-dow.patch diff --git a/Spigot-Server-Patches/0234-Allow-specifying-a-custom-authentication-servers-dow.patch b/Spigot-Server-Patches/0234-Allow-specifying-a-custom-authentication-servers-dow.patch new file mode 100644 index 0000000000..b9523e3c43 --- /dev/null +++ b/Spigot-Server-Patches/0234-Allow-specifying-a-custom-authentication-servers-dow.patch @@ -0,0 +1,46 @@ +From 6a2d8a485c793db1a77da15bb41fc961568cd0ce Mon Sep 17 00:00:00 2001 +From: kashike +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 f4b23703..f5cb9799 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; +@@ -270,4 +271,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 c5434e6b..75df9283 100644 +--- a/src/main/java/net/minecraft/server/LoginListener.java ++++ b/src/main/java/net/minecraft/server/LoginListener.java +@@ -250,6 +250,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.14.1 +