From 32cb9d0828828da3068259c9e0a3c0f5da170439 Mon Sep 17 00:00:00 2001 From: SmallJoker Date: Sat, 31 Jul 2021 19:54:52 +0200 Subject: Mods: Combine mod loading checks and deprection logging (#11503) This limits the logged deprecation messages to the mods that are loaded Unifies the mod naming convention check for CSM & SSM --- src/server/mods.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/mods.cpp b/src/server/mods.cpp index 83fa12da9..609d8c346 100644 --- a/src/server/mods.cpp +++ b/src/server/mods.cpp @@ -61,12 +61,8 @@ void ServerModManager::loadMods(ServerScripting *script) infostream << std::endl; // Load and run "mod" scripts for (const ModSpec &mod : m_sorted_mods) { - if (!string_allowed(mod.name, MODNAME_ALLOWED_CHARS)) { - throw ModError("Error loading mod \"" + mod.name + - "\": Mod name does not follow naming " - "conventions: " - "Only characters [a-z0-9_] are allowed."); - } + mod.checkAndLog(); + std::string script_path = mod.path + DIR_DELIM + "init.lua"; auto t = porting::getTimeMs(); script->loadMod(script_path, mod.name); -- cgit v1.2.3