aboutsummaryrefslogtreecommitdiff
ModeNameSize
-rw-r--r--.clang-format650logplain
-rw-r--r--.gitattributes28logplain
-rw-r--r--.gitignore1439logplain
-rw-r--r--.gitlab-ci.yml8911logplain
-rw-r--r--.mailmap2087logplain
-rw-r--r--.travis.yml2280logplain
-rw-r--r--CMakeLists.txt9062logplain
-rw-r--r--CONTRIBUTING.md6128logplain
-rw-r--r--LICENSE.txt6056logplain
-rw-r--r--README.md22151logplain
d---------build / android34logplain
d---------builtin310logplain
d---------client71logplain
d---------clientmods / preview34logplain
d---------cmake / Modules34logplain
d---------doc584logplain
d---------fonts1835logplain
d---------games / minimal34logplain
d---------lib94logplain
-rw-r--r--minetest.conf.example67445logplain
-rw-r--r--minetest.conf.example.extra2033logplain
d---------misc525logplain
d---------mods41logplain
d---------po1070logplain
d---------src12024logplain
d---------textures81logplain
d---------util288logplain
an class="hl kwc">std::map<std::string, ModSpec> &mods); // a ModConfiguration is a subset of installed mods, expected to have // all dependencies fullfilled, so it can be used as a list of mods to // load when the game starts. class ModConfiguration { public: // checks if all dependencies are fullfilled. bool isConsistent() const { return m_unsatisfied_mods.empty(); } const std::vector<ModSpec> &getMods() const { return m_sorted_mods; } const std::vector<ModSpec> &getUnsatisfiedMods() const { return m_unsatisfied_mods; } void printUnsatisfiedModsError() const; protected: ModConfiguration(const std::string &worldpath); // adds all mods in the given path. used for games, modpacks // and world-specific mods (worldmods-folders) void addModsInPath(const std::string &path); // adds all mods in the set. void addMods(const std::vector<ModSpec> &new_mods); 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 void resolveDependencies(); // mods with unmet dependencies. Before dependencies are resolved, // this is where all mods are stored. Afterwards this contains // only the ones with really unsatisfied dependencies. std::vector<ModSpec> m_unsatisfied_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. // Levels (mods in higher levels override mods in lower levels): // 1. game mod in modpack; 2. game mod; // 3. world mod in modpack; 4. world mod; // 5. addon mod in modpack; 6. addon mod. std::unordered_set<std::string> m_name_conflicts; // Deleted default constructor ModConfiguration() = default; }; #ifndef SERVER class ClientModConfiguration : public ModConfiguration { public: ClientModConfiguration(const std::string &path); }; #endif class ModMetadata : public Metadata { public: ModMetadata() = delete; ModMetadata(const std::string &mod_name); ~ModMetadata() = default; virtual void clear(); bool save(const std::string &root_path); bool load(const std::string &root_path); bool isModified() const { return m_modified; } const std::string &getModName() const { return m_mod_name; } virtual bool setString(const std::string &name, const std::string &var); private: std::string m_mod_name; bool m_modified = false; };