1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-06 18:25:21 +01:00

Server: delegate mod management & config to ServerModConfiguration (#7131)

* Server: delegate mod management & config to ServerModConfiguration (rename it to ServerModManager)

* Use c++11 range based loops
* Add unittests + experimental/default mod as a test case to permit testing mod loading in future tests
This commit is contained in:
Loïc Blot
2018-03-16 08:41:33 +01:00
committed by GitHub
parent 5e61f64ce2
commit 6c184947c3
13 changed files with 359 additions and 74 deletions

View File

@@ -78,7 +78,7 @@ public:
return m_unsatisfied_mods.empty();
}
std::vector<ModSpec> getMods()
const std::vector<ModSpec> &getMods() const
{
return m_sorted_mods;
}
@@ -102,6 +102,13 @@ protected:
void addModsFromConfig(const std::string &settings_path, const std::set<std::string> &mods);
void checkConflictsAndDeps();
protected:
// list of mods sorted such that they can be loaded in the
// given order with all dependencies being fullfilled. I.e.,
// every mod in this list has only dependencies on mods which
// appear earlier in the vector.
std::vector<ModSpec> m_sorted_mods;
private:
// move mods from m_unsatisfied_mods to m_sorted_mods
// in an order that satisfies dependencies
@@ -112,12 +119,6 @@ private:
// only the ones with really unsatisfied dependencies.
std::vector<ModSpec> m_unsatisfied_mods;
// list of mods sorted such that they can be loaded in the
// given order with all dependencies being fullfilled. I.e.,
// every mod in this list has only dependencies on mods which
// appear earlier in the vector.
std::vector<ModSpec> m_sorted_mods;
// set of mod names for which an unresolved name conflict
// exists. A name conflict happens when two or more mods
// at the same level have the same name but different paths.
@@ -132,13 +133,6 @@ private:
};
class ServerModConfiguration: public ModConfiguration
{
public:
ServerModConfiguration(const std::string &worldpath);
};
#ifndef SERVER
class ClientModConfiguration: public ModConfiguration
{