From e51a3a332ec450e36ac6805c3d84b847fb18947c Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Fri, 12 Aug 2016 18:08:53 -0500 Subject: [PATCH] Introduce a setting to handle offline proxies Servers behind a bungeecord proxy in offline mode will now properly pull offline mode UUIDs and data when this setting is set to false. Default is unchanged. --- ...setting-for-proxy-online-mode-status.patch | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Spigot-Server-Patches/0168-Add-setting-for-proxy-online-mode-status.patch diff --git a/Spigot-Server-Patches/0168-Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/0168-Add-setting-for-proxy-online-mode-status.patch new file mode 100644 index 0000000000..23259d70c0 --- /dev/null +++ b/Spigot-Server-Patches/0168-Add-setting-for-proxy-online-mode-status.patch @@ -0,0 +1,51 @@ +From 29786a2502ed0a436d942081543cdc21bc090214 Mon Sep 17 00:00:00 2001 +From: Gabriele C +Date: Fri, 5 Aug 2016 01:03:08 +0200 +Subject: [PATCH] Add setting for proxy online mode status + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index 058720f..ab4e305 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -228,4 +228,9 @@ public class PaperConfig { + private static void saveEmptyScoreboardTeams() { + saveEmptyScoreboardTeams = getBoolean("settings.save-empty-scoreboard-teams", false); + } ++ ++ public static boolean bungeeOnlineMode = true; ++ private static void bungeeOnlineMode() { ++ bungeeOnlineMode = getBoolean("settings.bungee-online-mode", true); ++ } + } +diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +index e21a8c4..41f6300 100644 +--- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java ++++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +@@ -65,7 +65,8 @@ public class NameReferencingFileConverter { + } + }), String.class); + +- if (minecraftserver.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now. ++ if (minecraftserver.getOnlineMode() ++ || (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode)) { // Spigot: bungee = online mode, for now. // Paper - Handle via setting + minecraftserver.getGameProfileRepository().findProfilesByNames(astring, Agent.MINECRAFT, profilelookupcallback); + } else { + String[] astring1 = astring; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 62a598c..0042cc5 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -1343,7 +1343,8 @@ public final class CraftServer implements Server { + // Spigot Start + GameProfile profile = null; + // Only fetch an online UUID in online mode +- if ( MinecraftServer.getServer().getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) ++ if ( MinecraftServer.getServer().getOnlineMode() ++ || (org.spigotmc.SpigotConfig.bungee && com.destroystokyo.paper.PaperConfig.bungeeOnlineMode)) // Paper - Handle via setting + { + profile = console.getUserCache().getProfile( name ); + } +-- +2.9.2.windows.1 +