diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2021-07-31 19:54:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-31 19:54:52 +0200 |
commit | 32cb9d0828828da3068259c9e0a3c0f5da170439 (patch) | |
tree | 7a768f3ffca8309b595db10102773c249db37c41 /src/server/mods.cpp | |
parent | e7cd4cfa25485610c05a906859e8365158a13f69 (diff) | |
download | minetest-32cb9d0828828da3068259c9e0a3c0f5da170439.tar.gz minetest-32cb9d0828828da3068259c9e0a3c0f5da170439.tar.bz2 minetest-32cb9d0828828da3068259c9e0a3c0f5da170439.zip |
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
Diffstat (limited to 'src/server/mods.cpp')
-rw-r--r-- | src/server/mods.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
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); |