2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 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
|
2021-11-09 08:59:15 +01:00
|
|
|
index 7a69f9d9bb9c05474d8fbab22d626529a41a66a1..f4735cc330822183e098a67f2c0f00f21db9e137 100644
|
2021-06-11 14:02:28 +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-11-09 08:59:15 +01:00
|
|
|
@@ -285,4 +286,9 @@ public class PaperConfig {
|
2021-06-11 14:02:28 +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));
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
2021-11-23 15:03:50 +01:00
|
|
|
index bf2dbc99a9b9580816d6a51e2774f8cde2989eef..b057dfd42e9439cd8a2a2933b736f0581da53b85 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
2021-11-23 15:03:50 +01:00
|
|
|
@@ -298,6 +298,10 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
|
2021-06-11 14:02:28 +02:00
|
|
|
ServerLoginPacketListenerImpl.this.gameProfile = ServerLoginPacketListenerImpl.this.createFakeProfile(gameprofile);
|
|
|
|
ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
|
|
|
|
} else {
|
|
|
|
+ // Paper start
|
|
|
|
+ if (com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage != null) {
|
|
|
|
+ ServerLoginPacketListenerImpl.this.disconnect(new TextComponent(com.destroystokyo.paper.PaperConfig.authenticationServersDownKickMessage));
|
|
|
|
+ } else // Paper end
|
|
|
|
ServerLoginPacketListenerImpl.this.disconnect(new TranslatableComponent("multiplayer.disconnect.authservers_down"));
|
|
|
|
ServerLoginPacketListenerImpl.LOGGER.error("Couldn't verify username because servers are unavailable");
|
|
|
|
}
|