2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Gabriele C <sgdc3.mail@gmail.com>
Date: Fri, 5 Aug 2016 01:03:08 +0200
Subject: [PATCH] Add setting for proxy online mode status
2021-06-11 17:52:05 +02:00
TODO: Add isProxyOnlineMode check to Metrics
2021-06-11 14:02:28 +02:00
2024-01-14 16:31:39 +01:00
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
2024-10-27 18:11:15 +01:00
index 5d9772a6c35e8f849e8879f510b2c586b148074c..7c2b2dbc03bf4c3308a3e2a34260fee56d646488 100644
2024-01-14 16:31:39 +01:00
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
2024-10-27 18:11:15 +01:00
@@ -571,7 +571,11 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
2024-01-14 16:31:39 +01:00
public boolean enforceSecureProfile() {
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
- return dedicatedserverproperties.enforceSecureProfile && dedicatedserverproperties.onlineMode && this.services.canValidateProfileKeys();
+ // Paper start - Add setting for proxy online mode status
+ return dedicatedserverproperties.enforceSecureProfile
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
+ && this.services.canValidateProfileKeys();
+ // Paper end - Add setting for proxy online mode status
}
@Override
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/server/players/GameProfileCache.java b/src/main/java/net/minecraft/server/players/GameProfileCache.java
2024-10-22 22:00:33 +02:00
index 22ed1e67ccb358655fe74cd1b1e19415f4e5bdd7..c89f4a885982f06823886c81fd386b8de029a3dd 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/players/GameProfileCache.java
+++ b/src/main/java/net/minecraft/server/players/GameProfileCache.java
2023-12-28 21:47:57 +01:00
@@ -89,7 +89,8 @@ public class GameProfileCache {
2023-12-05 22:34:01 +01:00
}
};
2021-06-11 14:02:28 +02:00
2024-01-15 12:38:39 +01:00
- if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name
2022-06-09 23:37:26 +02:00
+ if (!org.apache.commons.lang3.StringUtils.isBlank(name) // Paper - Don't lookup a profile with a blank name
2024-01-14 16:31:39 +01:00
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - Add setting for proxy online mode status
2023-12-05 22:34:01 +01:00
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
GameProfile gameprofile = (GameProfile) atomicreference.get();
2021-06-11 14:02:28 +02:00
2023-12-28 21:47:57 +01:00
@@ -106,7 +107,7 @@ public class GameProfileCache {
2021-06-11 14:02:28 +02:00
}
private static boolean usesAuthentication() {
- return GameProfileCache.usesAuthentication;
2024-01-14 16:31:39 +01:00
+ return io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode(); // Paper - Add setting for proxy online mode status
2021-06-11 14:02:28 +02:00
}
2022-03-18 04:53:36 +01:00
public void add(GameProfile profile) {
2021-06-11 14:02:28 +02:00
diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
2024-04-24 03:25:14 +02:00
index a0b0614ac7d2009db5c6c10ab4a5f09dd447c635..653856d0b8dcf2baf4cc77a276f17c8cc1fa717e 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java
+++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java
2024-02-01 10:15:57 +01:00
@@ -65,7 +65,8 @@ public class OldUsersConverter {
2021-06-11 14:02:28 +02:00
return new String[i];
});
- if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
2023-09-21 22:35:39 +02:00
+ if (server.usesAuthentication() ||
2024-01-14 16:31:39 +01:00
+ (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Add setting for proxy online mode status
2023-09-21 22:35:39 +02:00
server.getProfileRepository().findProfilesByNames(astring, callback);
2021-06-11 14:02:28 +02:00
} else {
String[] astring1 = astring;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2024-10-27 18:11:15 +01:00
index c6ea35f752c9a0bf9e5e07e3b501fd3fe8c30084..f970f821f5ac8cbad90ebb8dd8e8bf222ae229ae 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2024-10-27 18:11:15 +01:00
@@ -1891,7 +1891,7 @@ public final class CraftServer implements Server {
2024-01-14 10:46:04 +01:00
if (result == null) {
2021-06-11 14:02:28 +02:00
GameProfile profile = null;
// Only fetch an online UUID in online mode
2024-01-14 10:46:04 +01:00
- if (this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
2024-01-14 16:31:39 +01:00
+ if (this.getOnlineMode() || io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) { // Paper - Add setting for proxy online mode status
2024-01-14 10:46:04 +01:00
// This is potentially blocking :(
2021-07-07 08:52:40 +02:00
profile = this.console.getProfileCache().get(name).orElse(null);
2021-06-11 14:02:28 +02:00
}