From 10cb6e53ac9cc2536726445ab6782d22a74e71b8 Mon Sep 17 00:00:00 2001 From: F1F7Y <64418963+F1F7Y@users.noreply.github.com> Date: Sun, 2 Jul 2023 13:24:41 +0200 Subject: Basic mods blacklisting (#474) --- NorthstarDLL/mods/modmanager.cpp | 7 +++++++ NorthstarDLL/mods/modmanager.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'NorthstarDLL/mods') diff --git a/NorthstarDLL/mods/modmanager.cpp b/NorthstarDLL/mods/modmanager.cpp index 8ac9ac54..cdfe5384 100644 --- a/NorthstarDLL/mods/modmanager.cpp +++ b/NorthstarDLL/mods/modmanager.cpp @@ -56,6 +56,13 @@ Mod::Mod(fs::path modDir, char* jsonBuf) Name = modJson["Name"].GetString(); + // Don't load blacklisted mods + if (!strstr(GetCommandLineA(), "-nomodblacklist") && MODS_BLACKLIST.find(Name) != std::end(MODS_BLACKLIST)) + { + spdlog::warn("Skipping blacklisted mod \"{}\"!", Name); + return; + } + if (modJson.HasMember("Description")) Description = modJson["Description"].GetString(); else diff --git a/NorthstarDLL/mods/modmanager.h b/NorthstarDLL/mods/modmanager.h index a4c72f77..c25c95ba 100644 --- a/NorthstarDLL/mods/modmanager.h +++ b/NorthstarDLL/mods/modmanager.h @@ -13,6 +13,8 @@ const std::string REMOTE_MOD_FOLDER_SUFFIX = "/runtime/remote/mods"; const fs::path MOD_OVERRIDE_DIR = "mod"; const std::string COMPILED_ASSETS_SUFFIX = "/runtime/compiled"; +const std::set MODS_BLACKLIST = {"Mod Settings"}; + struct ModConVar { public: -- cgit v1.2.3