#include <common/c_internal.h>
#include "content/subgames.h"
#include "porting.h"
#include "filesys.h"
#include "settings.h"
#include "log.h"
#include "util/strfnd.h"
#include "defaultsettings.h"
#include "map_settings_manager.h"
#include "util/string.h"
Classes | |
struct | GameFindPath |
Macros | |
#define | MAX_WORLD_NAMES 100 |
#define | LEGACY_GAMEID "minetest" |
Functions | |
std::string | getSubgamePathEnv () |
static SubgameSpec | getSubgameSpec (const std::string &game_id, const std::string &game_path, const std::unordered_map< std::string, std::string > &mods_paths) |
SubgameSpec | findSubgame (const std::string &id) |
SubgameSpec | findWorldSubgame (const std::string &world_path) |
std::set< std::string > | getAvailableGameIds () |
std::vector< SubgameSpec > | getAvailableGames () |
bool | getWorldExists (const std::string &world_path) |
std::string | getWorldName (const std::string &world_path, const std::string &default_name) |
Try to get the displayed name of a world. | |
std::string | getWorldGameId (const std::string &world_path, bool can_be_legacy) |
std::string | getWorldPathEnv () |
std::vector< WorldSpec > | getAvailableWorlds () |
void | loadGameConfAndInitWorld (const std::string &path, const std::string &name, const SubgameSpec &gamespec, bool create_world) |
std::vector< std::string > | getEnvModPaths () |
#define LEGACY_GAMEID "minetest" |
Referenced by getWorldGameId().
#define MAX_WORLD_NAMES 100 |
Referenced by loadGameConfAndInitWorld().
SubgameSpec findSubgame | ( | const std::string & | id | ) |
References fs::AbsolutePath(), BasicStrfnd< T >::at_end(), DIR_DELIM, getEnvModPaths(), getSubgamePathEnv(), getSubgameSpec(), BasicStrfnd< T >::next(), PATH_DELIM, porting::path_share, porting::path_user, and fs::PathExists().
Referenced by findWorldSubgame(), get_game_from_cmdline(), getAvailableGames(), read_translation_file(), TestServerModManager::runTests(), and TEST_CASE().
SubgameSpec findWorldSubgame | ( | const std::string & | world_path | ) |
References DIR_DELIM, findSubgame(), getSubgameSpec(), getWorldGameId(), and fs::PathExists().
Referenced by ServerModManager::ServerModManager(), determine_subgame(), ModApiMainMenu::l_check_mod_configuration(), and ClientLauncher::launch_game().
std::set< std::string > getAvailableGameIds | ( | ) |
References BasicStrfnd< T >::at_end(), DIR_DELIM, fs::GetDirListing(), getSubgamePathEnv(), BasicStrfnd< T >::next(), PATH_DELIM, porting::path_share, porting::path_user, Settings::readConfigFile(), and removeStringEnd().
Referenced by getAvailableGames(), and list_game_ids().
std::vector< SubgameSpec > getAvailableGames | ( | ) |
References findSubgame(), and getAvailableGameIds().
Referenced by ModApiMainMenu::l_create_world(), and ModApiMainMenu::l_get_games().
std::vector< WorldSpec > getAvailableWorlds | ( | ) |
References BasicStrfnd< T >::at_end(), DIR_DELIM, fs::GetDirListing(), getWorldGameId(), getWorldName(), getWorldPathEnv(), infostream, WorldSpec::isValid(), BasicStrfnd< T >::next(), PATH_DELIM, porting::path_user, and fs::PathExists().
Referenced by auto_select_world(), get_world_from_cmdline(), ModApiMainMenu::l_delete_world(), ModApiMainMenu::l_get_worlds(), ClientLauncher::launch_game(), and list_worlds().
std::vector< std::string > getEnvModPaths | ( | ) |
References BasicStrfnd< T >::at_end(), BasicStrfnd< T >::next(), and PATH_DELIM.
Referenced by findSubgame(), and ModApiMainMenu::l_get_modpaths().
std::string getSubgamePathEnv | ( | ) |
References warningstream.
Referenced by findSubgame(), and getAvailableGameIds().
|
static |
References SubgameSpec::deprecation_msgs, DIR_DELIM, Settings::exists(), Settings::get(), Settings::getS32(), and Settings::readConfigFile().
Referenced by findSubgame(), and findWorldSubgame().
bool getWorldExists | ( | const std::string & | world_path | ) |
References DIR_DELIM, and fs::PathExists().
Referenced by determine_subgame().
std::string getWorldGameId | ( | const std::string & | world_path, |
bool | can_be_legacy ) |
References DIR_DELIM, Settings::exists(), Settings::get(), LEGACY_GAMEID, fs::PathExists(), and Settings::readConfigFile().
Referenced by determine_subgame(), findWorldSubgame(), getAvailableWorlds(), and ClientLauncher::launch_game().
std::string getWorldName | ( | const std::string & | world_path, |
const std::string & | default_name ) |
Try to get the displayed name of a world.
References DIR_DELIM, Settings::exists(), Settings::get(), and Settings::readConfigFile().
Referenced by getAvailableWorlds().
std::string getWorldPathEnv | ( | ) |
void loadGameConfAndInitWorld | ( | const std::string & | path, |
const std::string & | name, | ||
const SubgameSpec & | gamespec, | ||
bool | create_world ) |
References fs::CreateAllDirs(), Settings::createLayer(), DIR_DELIM, Settings::exists(), g_settings, Settings::get(), Settings::getBool(), Settings::getLayer(), SubgameSpec::id, infostream, MapSettingsManager::makeMapgenParams(), MAP_BLOCKSIZE, MAX_WORLD_NAMES, SubgameSpec::path, fs::PathExists(), Settings::readConfigFile(), Settings::removeSecureSettings(), MapSettingsManager::saveMapMeta(), Settings::set(), Settings::setBool(), MapSettingsManager::setMapSetting(), SL_GAME, and Settings::updateConfigFile().
Referenced by Server::init(), and ModApiMainMenu::l_create_world().