Manages server mods. More...
#include <mods.h>
Collaboration diagram for ServerModManager:Public Member Functions | |
| ServerModManager (const std::string &worldpath, SubgameSpec gamespec) | |
| Creates a ServerModManager. | |
| ServerModManager (std::nullptr_t) | |
| Creates an empty ServerModManager. | |
| void | loadMods (ServerScripting &script) |
| const ModSpec * | getModSpec (const std::string &modname) const |
| void | getModNames (std::vector< std::string > &modlist) const |
| const std::vector< ModSpec > & | getMods () const |
| const std::vector< ModSpec > & | getUnsatisfiedMods () const |
| bool | isConsistent () const |
| std::string | getUnsatisfiedModsError () const |
| void | getModsMediaPaths (std::vector< std::string > &paths) const |
| Recursively gets all paths of mod folders that can contain media files. | |
Private Attributes | |
| ModConfiguration | configuration |
Manages server mods.
All new calls to this class must be tested in test_servermodmanager.cpp
| ServerModManager::ServerModManager | ( | const std::string & | worldpath, |
| SubgameSpec | gamespec ) |
Creates a ServerModManager.
Manage server mods.
| worldpath | path to world |
| gamespec | game used by the world |
All new calls to this class must be tested in test_servermodmanager.cpp
References ModConfiguration::addGameMods(), ModConfiguration::addModsFromConfig(), ModConfiguration::addModsInPath(), SubgameSpec::addon_mods_paths, ModConfiguration::checkConflictsAndDeps(), configuration, and DIR_DELIM.
Here is the call graph for this function:
|
inlineexplicit |
Creates an empty ServerModManager.
For testing purposes. Note: definition looks like this so it isn't accidentally used.
| void ServerModManager::getModNames | ( | std::vector< std::string > & | modlist | ) | const |
References configuration, and ModConfiguration::getMods().
Here is the call graph for this function:
|
inline |
References configuration, and ModConfiguration::getMods().
Referenced by Server::AsyncRunStep(), and Server::getMods().
Here is the call graph for this function:
Here is the caller graph for this function:| void ServerModManager::getModsMediaPaths | ( | std::vector< std::string > & | paths | ) | const |
Recursively gets all paths of mod folders that can contain media files.
Result is ordered in descending priority, ie. files from an earlier path should not be replaced by files from a latter one.
| paths | result vector |
References configuration, DIR_DELIM, ModConfiguration::getMods(), fs::GetRecursiveDirs(), and ModSpec::path.
Referenced by Server::fillMediaCache().
Here is the call graph for this function:
Here is the caller graph for this function:| const ModSpec * ServerModManager::getModSpec | ( | const std::string & | modname | ) | const |
References configuration, and ModConfiguration::getMods().
Referenced by Server::getModSpec().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References configuration, and ModConfiguration::getUnsatisfiedMods().
Here is the call graph for this function:
|
inline |
References configuration, and ModConfiguration::getUnsatisfiedModsError().
Referenced by Server::init().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References configuration, and ModConfiguration::isConsistent().
Referenced by Server::init().
Here is the call graph for this function:
Here is the caller graph for this function:| void ServerModManager::loadMods | ( | ServerScripting & | script | ) |
References configuration, DIR_DELIM, ModConfiguration::getMods(), porting::getTimeMs(), infostream, ScriptApiBase::loadMod(), and ScriptApiServer::on_mods_loaded().
Referenced by Server::init().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Referenced by ServerModManager(), getModNames(), getMods(), getModsMediaPaths(), getModSpec(), getUnsatisfiedMods(), getUnsatisfiedModsError(), isConsistent(), and loadMods().