diff --git a/.gitignore b/.gitignore index 5b6891b3326..eb905b576f0 100644 --- a/.gitignore +++ b/.gitignore @@ -94,9 +94,11 @@ config/metrics/ API_file.txt New_API_file.txt -# Ignore Allowlist and Denylist files +# Ignore Allowlist and Denylist files (Whitelist and Blacklist are old filenames) allowlist.json denylist.json +whitelist.json +blacklist.json # Profiling related terasology.jfr diff --git a/docs/Modding-API.md b/docs/Modding-API.md index ed5065fe078..d2e81b2c284 100644 --- a/docs/Modding-API.md +++ b/docs/Modding-API.md @@ -1,7 +1,7 @@ Modding API ================= -Terasology's engine uses allowlisting approach to expose an API for modules using two primary methods and a rarely needed third one: +Terasology's engine uses an allowlisting approach to expose an API for modules using two primary methods and a rarely needed third one: * Classes or packages marked with the `@API` annotation * Classes or packages in the basic allowlist defined in `ExternalApiAllowlist.java` diff --git a/engine/src/main/java/org/terasology/engine/network/internal/ServerConnectListManager.java b/engine/src/main/java/org/terasology/engine/network/internal/ServerConnectListManager.java index 1c91de0fd88..c2189f19abd 100644 --- a/engine/src/main/java/org/terasology/engine/network/internal/ServerConnectListManager.java +++ b/engine/src/main/java/org/terasology/engine/network/internal/ServerConnectListManager.java @@ -34,8 +34,20 @@ public class ServerConnectListManager { private final Path allowlistPath; public ServerConnectListManager(Context context) { - denylistPath = PathManager.getInstance().getHomePath().resolve("denylist.json"); - allowlistPath = PathManager.getInstance().getHomePath().resolve("allowlist.json"); + // although this seems redundant, compiler wouldn't accept assigning then checking + if (Files.exists(PathManager.getInstance().getHomePath().resolve("denylist.json"))) { + denylistPath = PathManager.getInstance().getHomePath().resolve("denylist.json"); + } + else { + denylistPath = PathManager.getInstance().getHomePath().resolve("blacklist.json"); + } + // although this seems redundant, compiler wouldn't accept assigning then checking + if (Files.exists(PathManager.getInstance().getHomePath().resolve("allowlist.json"))) { + allowlistPath = PathManager.getInstance().getHomePath().resolve("allowlist.json"); + } + else { + allowlistPath = PathManager.getInstance().getHomePath().resolve("whitelist.json"); + } this.context = context; loadLists(); } diff --git a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectGameScreen.java b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectGameScreen.java index 293a07ed19f..af6e05371a6 100644 --- a/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectGameScreen.java +++ b/engine/src/main/java/org/terasology/engine/rendering/nui/layers/mainMenu/SelectGameScreen.java @@ -151,6 +151,13 @@ private void loadGame(GameInfo item) { if (isLoadingAsServer()) { Path denylistPath = PathManager.getInstance().getHomePath().resolve("denylist.json"); Path allowlistPath = PathManager.getInstance().getHomePath().resolve("allowlist.json"); + if (!Files.exists(denylistPath)) { + denylistPath = PathManager.getInstance().getHomePath().resolve("blacklist.json"); + } + + if (!Files.exists(allowlistPath)) { + allowlistPath = PathManager.getInstance().getHomePath().resolve("whitelist.json"); + } if (!Files.exists(denylistPath)) { try { Files.createFile(denylistPath);