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:
22
src/mods.h
22
src/mods.h
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user