Minetest  5.4.0
subgames.cpp File Reference
#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"
+ Include dependency graph for subgames.cpp:

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< SubgameSpecgetAvailableGames ()
 
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< WorldSpecgetAvailableWorlds ()
 
void loadGameConfAndInitWorld (const std::string &path, const std::string &name, const SubgameSpec &gamespec, bool create_world)
 

Macro Definition Documentation

◆ LEGACY_GAMEID

#define LEGACY_GAMEID   "minetest"

◆ MAX_WORLD_NAMES

#define MAX_WORLD_NAMES   100

Function Documentation

◆ findSubgame()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findWorldSubgame()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvailableGameIds()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvailableGames()

std::vector<SubgameSpec> getAvailableGames ( )

References findSubgame(), and getAvailableGameIds().

Referenced by ModApiMainMenu::l_create_world(), and ModApiMainMenu::l_get_games().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAvailableWorlds()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubgamePathEnv()

std::string getSubgamePathEnv ( )

Referenced by findSubgame(), and getAvailableGameIds().

+ Here is the caller graph for this function:

◆ getWorldExists()

bool getWorldExists ( const std::string &  world_path)

References DIR_DELIM, and fs::PathExists().

Referenced by determine_subgame().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWorldGameId()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWorldName()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getWorldPathEnv()

std::string getWorldPathEnv ( )

Referenced by getAvailableWorlds().

+ Here is the caller graph for this function:

◆ loadGameConfAndInitWorld()

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: