Purpur/patches/server/0181-Config-for-unverified-username-message.patch
BillyGalbreath 417a025211
Updated Upstream (Paper & Pufferfish)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@e4f5e1c Bump netty

Pufferfish Changes:
pufferfish-gg/Pufferfish@a8543a4 #33 Fix anti-xray related crash bug
pufferfish-gg/Pufferfish@aefcb1a Updated Upstream (Paper)
2022-06-12 22:59:25 -05:00

40 lines
3.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Ben Kerllenevich <ben@omega24.dev>
Date: Wed, 19 May 2021 15:33:43 -0400
Subject: [PATCH] Config for unverified username message
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 039b47e19d672ec9066c41fcc6342523992bf7b6..982a0bb5fc0a8d62e750926217dc36690709de8b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -403,7 +403,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener
ServerLoginPacketListenerImpl.this.gameProfile = ServerLoginPacketListenerImpl.this.createFakeProfile(gameprofile);
ServerLoginPacketListenerImpl.this.state = ServerLoginPacketListenerImpl.State.READY_TO_ACCEPT;
} else {
- ServerLoginPacketListenerImpl.this.disconnect(Component.translatable("multiplayer.disconnect.unverified_username"));
+ ServerLoginPacketListenerImpl.this.disconnect(org.purpurmc.purpur.PurpurConfig.unverifiedUsername.equals("default") ? Component.translatable("multiplayer.disconnect.unverified_username") : io.papermc.paper.adventure.PaperAdventure.asVanilla(net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.purpurmc.purpur.PurpurConfig.unverifiedUsername))); // Purpur
ServerLoginPacketListenerImpl.LOGGER.error("Username '{}' tried to join with an invalid session", gameprofile.getName());
}
} catch (AuthenticationUnavailableException authenticationunavailableexception) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index a388dd5495b6021bf7e13ef3d5591e750ab9b9e5..8cd0f1ce58694922d186b483f16ccc45ebd8858d 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -178,6 +178,7 @@ public class PurpurConfig {
public static String pingCommandOutput = "<green>%s's ping is %sms";
public static String tpsbarCommandOutput = "<green>Tpsbar toggled <onoff> for <target>";
public static String dontRunWithScissors = "<red><italic>Don't run with scissors!";
+ public static String unverifiedUsername = "default";
private static void messages() {
cannotRideMob = getString("settings.messages.cannot-ride-mob", cannotRideMob);
afkBroadcastAway = getString("settings.messages.afk-broadcast-away", afkBroadcastAway);
@@ -189,6 +190,7 @@ public class PurpurConfig {
pingCommandOutput = getString("settings.messages.ping-command-output", pingCommandOutput);
tpsbarCommandOutput = getString("settings.messages.tpsbar-command-output", tpsbarCommandOutput);
dontRunWithScissors = getString("settings.messages.dont-run-with-scissors", dontRunWithScissors);
+ unverifiedUsername = getString("settings.messages.unverified-username", unverifiedUsername);
}
public static String deathMsgRunWithScissors = "<player> slipped and fell on their shears";