Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
subgames.h File Reference
#include <string>
#include <set>
#include <unordered_map>
#include <vector>
+ Include dependency graph for subgames.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SubgameSpec
 
struct  WorldSpec
 

Functions

SubgameSpec findSubgame (const std::string &id)
 
SubgameSpec findWorldSubgame (const std::string &world_path)
 
std::set< std::string > getAvailableGameIds ()
 
std::vector< SubgameSpecgetAvailableGames ()
 
std::vector< std::string > getEnvModPaths ()
 
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=false)
 
std::vector< WorldSpecgetAvailableWorlds ()
 
void loadGameConfAndInitWorld (const std::string &path, const std::string &name, const SubgameSpec &gamespec, bool create_world)
 

Function Documentation

◆ findSubgame()

SubgameSpec findSubgame ( const std::string &  id)

References fs::AbsolutePath(), BasicStrfnd< T >::at_end(), SubgameSpec::deprecation_msgs, DIR_DELIM, Settings::exists(), Settings::get(), getEnvModPaths(), getImagePath(), Settings::getS32(), getSubgamePathEnv(), BasicStrfnd< T >::next(), PATH_DELIM, porting::path_share, porting::path_user, fs::PathExists(), and Settings::readConfigFile().

Referenced by findWorldSubgame(), get_game_from_cmdline(), getAvailableGames(), and TestServerModManager::runTests().

+ 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::path, fs::PathExists(), Settings::readConfigFile(), and SubgameSpec::title.

Referenced by ServerModManager::ServerModManager(), determine_subgame(), ModApiMainMenu::l_check_mod_configuration(), 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:

◆ getEnvModPaths()

std::vector< std::string > getEnvModPaths ( )

References BasicStrfnd< T >::at_end(), BasicStrfnd< T >::next(), and PATH_DELIM.

Referenced by findSubgame(), and ModApiMainMenu::l_get_modpaths().

+ Here is the call graph for this function:
+ 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 = false 
)

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:

◆ loadGameConfAndInitWorld()

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

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