Add setting for proxy online mode status
TODO: Add isProxyOnlineMode check to Metrics
This commit is contained in:
parent
a55727ff06
commit
f7ae11f984
4 changed files with 53 additions and 27 deletions
|
@ -233,19 +233,20 @@
|
||||||
Thread thread1 = new Thread(new ServerWatchdog(this));
|
Thread thread1 = new Thread(new ServerWatchdog(this));
|
||||||
|
|
||||||
thread1.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandlerWithName(DedicatedServer.LOGGER));
|
thread1.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandlerWithName(DedicatedServer.LOGGER));
|
||||||
@@ -215,6 +318,12 @@
|
@@ -213,7 +316,13 @@
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ public java.io.File getPluginsFolder() {
|
+ public java.io.File getPluginsFolder() {
|
||||||
+ return (java.io.File) this.options.valueOf("plugins");
|
+ return (java.io.File) this.options.valueOf("plugins");
|
||||||
+ }
|
}
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSpawningMonsters() {
|
public boolean isSpawningMonsters() {
|
||||||
return this.settings.getProperties().spawnMonsters && super.isSpawningMonsters();
|
|
||||||
@@ -293,6 +402,7 @@
|
@@ -293,6 +402,7 @@
|
||||||
this.queryThreadGs4.stop();
|
this.queryThreadGs4.stop();
|
||||||
}
|
}
|
||||||
|
@ -291,7 +292,20 @@
|
||||||
return false;
|
return false;
|
||||||
} else if (this.getPlayerList().getOps().isEmpty()) {
|
} else if (this.getPlayerList().getOps().isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -541,16 +659,52 @@
|
@@ -453,7 +571,11 @@
|
||||||
|
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
|
||||||
|
@@ -541,16 +663,52 @@
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPluginNames() {
|
public String getPluginNames() {
|
||||||
|
@ -348,7 +362,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void storeUsingWhiteList(boolean useWhitelist) {
|
public void storeUsingWhiteList(boolean useWhitelist) {
|
||||||
@@ -660,4 +814,15 @@
|
@@ -660,4 +818,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
--- a/net/minecraft/server/players/GameProfileCache.java
|
--- a/net/minecraft/server/players/GameProfileCache.java
|
||||||
+++ b/net/minecraft/server/players/GameProfileCache.java
|
+++ b/net/minecraft/server/players/GameProfileCache.java
|
||||||
@@ -85,10 +85,11 @@
|
@@ -85,10 +85,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onProfileLookupFailed(String s1, Exception exception) {
|
public void onProfileLookupFailed(String s1, Exception exception) {
|
||||||
|
@ -9,11 +9,21 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
+ if (!org.apache.commons.lang3.StringUtils.isBlank(name)) // Paper - Don't lookup a profile with a blank name
|
+ if (!org.apache.commons.lang3.StringUtils.isBlank(name) // Paper - Don't lookup a profile with a blank name
|
||||||
|
+ && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) // Paper - Add setting for proxy online mode status
|
||||||
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
|
repository.findProfilesByNames(new String[]{name}, profilelookupcallback);
|
||||||
GameProfile gameprofile = (GameProfile) atomicreference.get();
|
GameProfile gameprofile = (GameProfile) atomicreference.get();
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@
|
@@ -105,7 +107,7 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean usesAuthentication() {
|
||||||
|
- return GameProfileCache.usesAuthentication;
|
||||||
|
+ return io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode(); // Paper - Add setting for proxy online mode status
|
||||||
|
}
|
||||||
|
|
||||||
|
public void add(GameProfile profile) {
|
||||||
|
@@ -117,7 +119,7 @@
|
||||||
GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date);
|
GameProfileCache.GameProfileInfo usercache_usercacheentry = new GameProfileCache.GameProfileInfo(profile, date);
|
||||||
|
|
||||||
this.safeAdd(usercache_usercacheentry);
|
this.safeAdd(usercache_usercacheentry);
|
||||||
|
@ -22,7 +32,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
private long getNextOperation() {
|
private long getNextOperation() {
|
||||||
@@ -142,15 +143,15 @@
|
@@ -142,15 +144,15 @@
|
||||||
usercache_usercacheentry.setLastAccess(this.getNextOperation());
|
usercache_usercacheentry.setLastAccess(this.getNextOperation());
|
||||||
optional = Optional.of(usercache_usercacheentry.getProfile());
|
optional = Optional.of(usercache_usercacheentry.getProfile());
|
||||||
} else {
|
} else {
|
||||||
|
@ -41,7 +51,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return optional;
|
return optional;
|
||||||
@@ -208,7 +209,7 @@
|
@@ -208,7 +210,7 @@
|
||||||
|
|
||||||
label54:
|
label54:
|
||||||
{
|
{
|
||||||
|
@ -50,7 +60,7 @@
|
||||||
|
|
||||||
try {
|
try {
|
||||||
JsonArray jsonarray = (JsonArray) this.gson.fromJson(bufferedreader, JsonArray.class);
|
JsonArray jsonarray = (JsonArray) this.gson.fromJson(bufferedreader, JsonArray.class);
|
||||||
@@ -217,7 +218,7 @@
|
@@ -217,7 +219,7 @@
|
||||||
DateFormat dateformat = GameProfileCache.createDateFormat();
|
DateFormat dateformat = GameProfileCache.createDateFormat();
|
||||||
|
|
||||||
jsonarray.forEach((jsonelement) -> {
|
jsonarray.forEach((jsonelement) -> {
|
||||||
|
@ -59,7 +69,7 @@
|
||||||
|
|
||||||
Objects.requireNonNull(list);
|
Objects.requireNonNull(list);
|
||||||
optional.ifPresent(list::add);
|
optional.ifPresent(list::add);
|
||||||
@@ -250,6 +251,11 @@
|
@@ -250,6 +252,11 @@
|
||||||
}
|
}
|
||||||
} catch (FileNotFoundException filenotfoundexception) {
|
} catch (FileNotFoundException filenotfoundexception) {
|
||||||
;
|
;
|
||||||
|
@ -71,7 +81,7 @@
|
||||||
} catch (JsonParseException | IOException ioexception) {
|
} catch (JsonParseException | IOException ioexception) {
|
||||||
GameProfileCache.LOGGER.warn("Failed to load profile cache {}", this.file, ioexception);
|
GameProfileCache.LOGGER.warn("Failed to load profile cache {}", this.file, ioexception);
|
||||||
}
|
}
|
||||||
@@ -257,14 +263,15 @@
|
@@ -257,14 +264,15 @@
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,7 +99,7 @@
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
|
BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8);
|
||||||
@@ -289,6 +296,14 @@
|
@@ -289,6 +297,14 @@
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,16 +10,17 @@
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
import net.minecraft.server.dedicated.DedicatedServer;
|
import net.minecraft.server.dedicated.DedicatedServer;
|
||||||
import net.minecraft.util.StringUtil;
|
import net.minecraft.util.StringUtil;
|
||||||
@@ -62,7 +65,7 @@
|
@@ -62,7 +65,8 @@
|
||||||
return new String[i];
|
return new String[i];
|
||||||
});
|
});
|
||||||
|
|
||||||
- if (server.usesAuthentication()) {
|
- if (server.usesAuthentication()) {
|
||||||
+ if (server.usesAuthentication() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
|
+ if (server.usesAuthentication() ||
|
||||||
|
+ (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode())) { // Spigot: bungee = online mode, for now. // Paper - Add setting for proxy online mode status
|
||||||
server.getProfileRepository().findProfilesByNames(astring, callback);
|
server.getProfileRepository().findProfilesByNames(astring, callback);
|
||||||
} else {
|
} else {
|
||||||
String[] astring1 = astring;
|
String[] astring1 = astring;
|
||||||
@@ -85,7 +88,7 @@
|
@@ -85,7 +89,7 @@
|
||||||
try {
|
try {
|
||||||
gameprofilebanlist.load();
|
gameprofilebanlist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
|
@ -28,7 +29,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +146,7 @@
|
@@ -143,7 +147,7 @@
|
||||||
try {
|
try {
|
||||||
ipbanlist.load();
|
ipbanlist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
|
@ -37,7 +38,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,7 +187,7 @@
|
@@ -184,7 +188,7 @@
|
||||||
try {
|
try {
|
||||||
oplist.load();
|
oplist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
|
@ -46,7 +47,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,7 +231,7 @@
|
@@ -228,7 +232,7 @@
|
||||||
try {
|
try {
|
||||||
whitelist.load();
|
whitelist.load();
|
||||||
} catch (IOException ioexception) {
|
} catch (IOException ioexception) {
|
||||||
|
@ -55,10 +56,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,6 +350,38 @@
|
@@ -346,7 +350,39 @@
|
||||||
|
private void movePlayerFile(File playerDataFolder, String fileName, String uuid) {
|
||||||
File file5 = new File(file, fileName + ".dat");
|
File file5 = new File(file, fileName + ".dat");
|
||||||
File file6 = new File(playerDataFolder, uuid + ".dat");
|
File file6 = new File(playerDataFolder, uuid + ".dat");
|
||||||
|
+
|
||||||
+ // CraftBukkit start - Use old file name to seed lastKnownName
|
+ // CraftBukkit start - Use old file name to seed lastKnownName
|
||||||
+ CompoundTag root = null;
|
+ CompoundTag root = null;
|
||||||
+
|
+
|
||||||
|
@ -71,7 +73,7 @@
|
||||||
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception);
|
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception);
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
+ if (root != null) {
|
+ if (root != null) {
|
||||||
+ if (!root.contains("bukkit")) {
|
+ if (!root.contains("bukkit")) {
|
||||||
+ root.put("bukkit", new CompoundTag());
|
+ root.put("bukkit", new CompoundTag());
|
||||||
|
|
|
@ -1891,7 +1891,7 @@ public final class CraftServer implements Server {
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
GameProfile profile = null;
|
GameProfile profile = null;
|
||||||
// Only fetch an online UUID in online mode
|
// Only fetch an online UUID in online mode
|
||||||
if (this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now.
|
if (this.getOnlineMode() || io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) { // Paper - Add setting for proxy online mode status
|
||||||
// This is potentially blocking :(
|
// This is potentially blocking :(
|
||||||
profile = this.console.getProfileCache().get(name).orElse(null);
|
profile = this.console.getProfileCache().get(name).orElse(null);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue