#include "content/subgames.h"
#include "porting.h"
#include "filesys.h"
#include "settings.h"
#include "log.h"
#include "util/strfnd.h"
#include "defaultsettings.h"
#include "mapgen/mapgen.h"
#include "util/string.h"
#include "client/tile.h"
Classes | |
struct | GameFindPath |
Macros | |
#define | MAX_WORLD_NAMES 100 |
#define | LEGACY_GAMEID "minetest" |
Functions | |
std::string | getSubgamePathEnv () |
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. More... | |
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) |
#define LEGACY_GAMEID "minetest" |
#define MAX_WORLD_NAMES 100 |
SubgameSpec findSubgame | ( | const std::string & | id | ) |
References BasicStrfnd< T >::at_end(), DIR_DELIM, Settings::exists(), Settings::get(), getImagePath(), Settings::getS32(), getSubgamePathEnv(), BasicStrfnd< T >::next(), PATH_DELIM, porting::path_share, porting::path_user, fs::PathExists(), and Settings::readConfigFile().
Referenced by determine_subgame(), findWorldSubgame(), get_game_from_cmdline(), and getAvailableGames().
SubgameSpec findWorldSubgame | ( | const std::string & | world_path | ) |
References DIR_DELIM, Settings::exists(), findSubgame(), SubgameSpec::gamemods_path, Settings::get(), getWorldGameId(), SubgameSpec::id, SubgameSpec::name, SubgameSpec::path, fs::PathExists(), and Settings::readConfigFile().
Referenced by ServerModManager::ServerModManager(), determine_subgame(), 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::string getSubgamePathEnv | ( | ) |
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, g_settings, Settings::getBool(), Settings::getLayer(), SubgameSpec::id, infostream, MAX_WORLD_NAMES, params, SubgameSpec::path, fs::PathExists(), Settings::removeSecureSettings(), fs::safeWriteToFile(), Settings::set(), Settings::setBool(), SL_GAME, Settings::updateConfigFile(), verbosestream, and Settings::writeLines().
Referenced by Server::init(), and ModApiMainMenu::l_create_world().