Better offline mode warning (#330)

This commit is contained in:
Bierque Jason
2021-05-13 01:37:14 +02:00
committed by GitHub
parent c1efe3c229
commit beed258ee9
3 changed files with 22 additions and 3 deletions

View File

@@ -104,6 +104,25 @@ index dd0daf3138a38d0c8a399e6cb54bbc58af47f710..53d847b863a957639ff2e58280861316
}
public CrashReport b(CrashReport crashreport) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 858bd62d2a17c15ee573c5cd607a876d3a99c2b1..8eab794e5c8d245b94faaab8abd45a5a5091be51 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -260,11 +260,12 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
// Spigot start
- if (org.spigotmc.SpigotConfig.bungee) {
- DedicatedServer.LOGGER.warn("Whilst this makes it possible to use BungeeCord, unless access to your server is properly restricted, it also opens up the ability for hackers to connect with any username they choose.");
+ if (com.destroystokyo.paper.PaperConfig.isProxyOnlineMode()) { // Purpur
+ DedicatedServer.LOGGER.warn("Whilst this makes it possible to use BungeeCord or Velocity, unless access to your server is properly restricted, it also opens up the ability for hackers to connect with any username they choose."); // Purpur
DedicatedServer.LOGGER.warn("Please see http://www.spigotmc.org/wiki/firewall-guide/ for further information.");
} else {
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
+ DedicatedServer.LOGGER.warn("You will not be offered any support as long as the server allows offline-mode players to join."); // Purpur
}
// Spigot end
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
diff --git a/src/main/java/net/pl3x/purpur/PurpurVersionFetcher.java b/src/main/java/net/pl3x/purpur/PurpurVersionFetcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..cabfcebf9f944f7a2a2a1cffc7401435803a8741

View File

@@ -45,7 +45,7 @@ index 14ac28d4d6b1ab0f0a70dfefc589f7723a1d2e1a..4eb122cfd31902df9789d2e8ff261520
config.save(CONFIG_FILE);
} catch (IOException ex) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 858bd62d2a17c15ee573c5cd607a876d3a99c2b1..a76219e59c24862b9c1e09e4a2a29cf2a6260514 100644
index 8eab794e5c8d245b94faaab8abd45a5a5091be51..017e19620ddf6b05cd12256f2381b9d611350bc4 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -212,6 +212,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer

View File

@@ -29,10 +29,10 @@ index e3c3b2eb03ad132a91140cb459fd8f378154ee2e..176fc4c8b7c5ef45b29cb8aaa1b1ff16
this.isRestarting = isRestarting;
this.hasLoggedStop = true; // Paper
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index a76219e59c24862b9c1e09e4a2a29cf2a6260514..4f7fed0418df17b80cb41e16bb1978c5cb284810 100644
index 017e19620ddf6b05cd12256f2381b9d611350bc4..9fd4a40170737b993678144790eceb0a98e9b6d1 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -324,6 +324,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
@@ -325,6 +325,8 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
MinecraftServerBeans.a((MinecraftServer) this);
}