#include <settings.h>
Public Member Functions | |
Settings (std::string_view end_tag="") | |
Settings (std::string_view end_tag, SettingsHierarchy *h, int settings_layer) | |
~Settings () | |
Settings & | operator= (const Settings &other) |
bool | readConfigFile (const char *filename) |
bool | updateConfigFile (const char *filename) |
bool | parseCommandLine (int argc, char *argv[], const std::map< std::string, ValueSpec > &allowed_options) |
bool | parseConfigLines (std::istream &is) |
void | writeLines (std::ostream &os, u32 tab_depth=0) const |
Settings * | getGroup (const std::string &name) const |
const std::string & | get (const std::string &name) const |
bool | getBool (const std::string &name) const |
u16 | getU16 (const std::string &name) const |
s16 | getS16 (const std::string &name) const |
u32 | getU32 (const std::string &name) const |
s32 | getS32 (const std::string &name) const |
u64 | getU64 (const std::string &name) const |
float | getFloat (const std::string &name) const |
float | getFloat (const std::string &name, float min, float max) const |
v2f | getV2F (const std::string &name) const |
v3f | getV3F (const std::string &name) const |
u32 | getFlagStr (const std::string &name, const FlagDesc *flagdesc, u32 *flagmask) const |
bool | getNoiseParams (const std::string &name, NoiseParams &np) const |
bool | getNoiseParamsFromValue (const std::string &name, NoiseParams &np) const |
bool | getNoiseParamsFromGroup (const std::string &name, NoiseParams &np) const |
std::vector< std::string > | getNames () const |
bool | exists (const std::string &name) const |
bool | existsLocal (const std::string &name) const |
bool | getGroupNoEx (const std::string &name, Settings *&val) const |
bool | getNoEx (const std::string &name, std::string &val) const |
bool | getFlag (const std::string &name) const |
bool | getU16NoEx (const std::string &name, u16 &val) const |
bool | getS16NoEx (const std::string &name, s16 &val) const |
bool | getU32NoEx (const std::string &name, u32 &val) const |
bool | getS32NoEx (const std::string &name, s32 &val) const |
bool | getU64NoEx (const std::string &name, u64 &val) const |
bool | getFloatNoEx (const std::string &name, float &val) const |
bool | getV2FNoEx (const std::string &name, v2f &val) const |
bool | getV3FNoEx (const std::string &name, v3f &val) const |
bool | getFlagStrNoEx (const std::string &name, u32 &val, const FlagDesc *flagdesc) const |
bool | setEntry (const std::string &name, const void *entry, bool set_group) |
bool | set (const std::string &name, const std::string &value) |
bool | setDefault (const std::string &name, const std::string &value) |
bool | setGroup (const std::string &name, const Settings &group) |
bool | setBool (const std::string &name, bool value) |
bool | setS16 (const std::string &name, s16 value) |
bool | setU16 (const std::string &name, u16 value) |
bool | setS32 (const std::string &name, s32 value) |
bool | setU64 (const std::string &name, u64 value) |
bool | setFloat (const std::string &name, float value) |
bool | setV2F (const std::string &name, v2f value) |
bool | setV3F (const std::string &name, v3f value) |
bool | setFlagStr (const std::string &name, u32 flags, const FlagDesc *flagdesc=nullptr, u32 flagmask=U32_MAX) |
bool | setNoiseParams (const std::string &name, const NoiseParams &np) |
bool | remove (const std::string &name) |
void | setDefault (const std::string &name, const FlagDesc *flagdesc, u32 flags) |
const FlagDesc * | getFlagDescFallback (const std::string &name) const |
void | registerChangedCallback (const std::string &name, SettingsChangedCallback cbf, void *userdata=NULL) |
size_t | deregisterAllChangedCallbacks (const void *userdata) |
void | removeSecureSettings () |
int | getLayer () const |
Static Public Member Functions | |
static Settings * | createLayer (SettingsLayer sl, std::string_view end_tag="") |
static Settings * | getLayer (SettingsLayer sl) |
Private Member Functions | |
SettingsParseEvent | parseConfigObject (const std::string &line, std::string &name, std::string &value) |
bool | updateConfigObject (std::istream &is, std::ostream &os, u32 tab_depth=0) |
Settings * | getParent () const |
const SettingsEntry & | getEntry (const std::string &name) const |
void | clearNoLock () |
void | doCallbacks (const std::string &name) const |
Static Private Member Functions | |
static bool | checkNameValid (std::string_view name) |
static bool | checkValueValid (std::string_view value) |
static std::string | getMultiline (std::istream &is, size_t *num_lines=NULL) |
static void | printEntry (std::ostream &os, const std::string &name, const SettingsEntry &entry, u32 tab_depth=0) |
Private Attributes | |
SettingEntries | m_settings |
SettingsCallbackMap | m_callbacks |
std::string | m_end_tag |
std::mutex | m_callback_mutex |
std::mutex | m_mutex |
SettingsHierarchy * | m_hierarchy = nullptr |
int | m_settingslayer = -1 |
Static Private Attributes | |
static std::unordered_map< std::string, const FlagDesc * > | s_flags |
Friends | |
class | TestSettings |
class | LuaSettings |
|
inline |
Referenced by createLayer(), parseConfigLines(), setGroup(), and setNoiseParams().
Settings::Settings | ( | std::string_view | end_tag, |
SettingsHierarchy * | h, | ||
int | settings_layer ) |
References m_hierarchy, m_settingslayer, and SettingsHierarchy::onLayerCreated().
Settings::~Settings | ( | ) |
References clearNoLock(), m_hierarchy, m_mutex, m_settingslayer, and SettingsHierarchy::onLayerRemoved().
|
staticprivate |
|
staticprivate |
|
private |
References m_settings.
Referenced by ~Settings(), and operator=().
|
static |
References Settings(), and g_hierarchy.
Referenced by Server::init(), init_common(), loadGameConfAndInitWorld(), TestMapSettingsManager::makeUserConfig(), set_default_settings(), TestSettings::testDefaults(), and TestSettings::testFlagDesc().
size_t Settings::deregisterAllChangedCallbacks | ( | const void * | userdata | ) |
References m_callback_mutex, m_callbacks, and settings.
Referenced by ClientLauncher::~ClientLauncher(), ClientMap::~ClientMap(), Clouds::~Clouds(), FontEngine::~FontEngine(), Game::~Game(), GameGlobalShaderConstantSetter::~GameGlobalShaderConstantSetter(), GUIEngine::~GUIEngine(), Hud::~Hud(), RenderingEngine::~RenderingEngine(), and PlayerSettings::deregisterSettingsCallback().
|
private |
References m_callback_mutex, and m_callbacks.
Referenced by remove(), and set().
bool Settings::exists | ( | const std::string & | name | ) | const |
References existsLocal(), and getParent().
Referenced by Database_Redis::Database_Redis(), ServerMap::ServerMap(), PlayerDatabaseFiles::deSerialize(), game_configure_port(), get_game_from_cmdline(), get_world_from_cmdline(), get_world_from_config(), getSubgameSpec(), getWorldGameId(), getWorldName(), ServerEnvironment::init(), ClientLauncher::init_args(), init_log_streams(), LuaSettings::l_get(), LuaSettings::l_get_bool(), LuaSettings::l_get_np_group(), ClientLauncher::launch_game(), loadGameConfAndInitWorld(), ServerEnvironment::loadMeta(), main(), migrate_map_database(), ServerEnvironment::migrateAuthDatabase(), Server::migrateModStorageDatabase(), ServerEnvironment::migratePlayersDatabase(), Server::openModStorageDatabase(), parseContentInfo(), parseModContents(), read_config_file(), run_dedicated_server(), Server::SendActiveObjectRemoveAdd(), ServerList::sendAnnounce(), and setup_log_params().
bool Settings::existsLocal | ( | const std::string & | name | ) | const |
References m_mutex, and m_settings.
Referenced by exists(), ModApiMainMenu::l_create_world(), LuaSettings::l_has(), and migrate_settings().
const std::string & Settings::get | ( | const std::string & | name | ) | const |
References getEntry(), SettingsEntry::is_group, and SettingsEntry::value.
Referenced by sound::ALExtensions::ALExtensions(), ChatBuffer::ChatBuffer(), Database_Redis::Database_Redis(), HTTPFetchOngoing::HTTPFetchOngoing(), Hud::Hud(), RenderingEngine::RenderingEngine(), ServerMap::ServerMap(), Server::~Server(), ModConfiguration::addModsFromConfig(), addPostProcessing(), checkModNameWhitelisted(), chooseVideoDriver(), compare_settings(), Game::createSingleplayerServer(), PlayerDatabaseFiles::deSerialize(), ShaderSource::generateShader(), get_deprecated_handling_mode(), get_game_from_cmdline(), get_world_from_cmdline(), get_world_from_config(), getBool(), getFlagStr(), getFloat(), getFloat(), getKeySetting(), TouchInteraction::getMode(), getNoEx(), getS16(), getS32(), getShaderPath(), Server::getStatusString(), getSubgameSpec(), getTextureDirs(), getU16(), getU32(), getU64(), getV2F(), getV3F(), getWorldGameId(), getWorldName(), Server::handleCommand_Init(), id_to_keycode(), Server::init(), ClientLauncher::init_args(), init_common(), init_log_streams(), FontEngine::initFont(), RenderingEngine::initialize(), ModApiMainMenu::l_create_world(), LuaSettings::l_get(), ClientLauncher::launch_game(), loadGameConfAndInitWorld(), GUIEngine::loadMainMenuScript(), ServerEnvironment::loadMeta(), main(), Client::makeScreenshot(), migrate_map_database(), ServerEnvironment::migrateAuthDatabase(), Server::migrateModStorageDatabase(), ServerEnvironment::migratePlayersDatabase(), JoystickController::onJoystickConnect(), ClientMap::onSettingChanged(), Server::openModStorageDatabase(), parseContentInfo(), parseModContents(), read_config_file(), Game::readSettings(), TextureSettings::readSettings(), recompress_map_database(), run_dedicated_server(), ServerList::sendAnnounce(), Server::sendMediaAnnouncement(), setup_log_params(), Game::shouldShowTouchControls(), Game::showPauseMenu(), Server::step(), TestSettings::testAllSettings(), TestConnection::testConnectSendReceive(), TestSettings::testDefaults(), and TestSocket::testIPv4Socket().
bool Settings::getBool | ( | const std::string & | name | ) | const |
References get(), and is_yes().
Referenced by AsyncWorkerThread::AsyncWorkerThread(), Camera::Camera(), ChatBuffer::ChatBuffer(), Client::Client(), Clouds::Clouds(), EmergeManager::EmergeManager(), EmergeScripting::EmergeScripting(), Environment::Environment(), GameGlobalShaderConstantSetter::GameGlobalShaderConstantSetter(), GUIChatConsole::GUIChatConsole(), GUIEngine::GUIEngine(), GUIFormSpecMenu::GUIFormSpecMenu(), HTTPFetchOngoing::HTTPFetchOngoing(), Hud::Hud(), MapBlockMesh::MapBlockMesh(), MeshUpdateQueue::MeshUpdateQueue(), Minimap::Minimap(), PlayerSAO::PlayerSAO(), RenderingEngine::RenderingEngine(), ServerScripting::ServerScripting(), ShaderSource::ShaderSource(), ShadowRenderer::ShadowRenderer(), Sky::Sky(), TextureSource::TextureSource(), TouchControls::TouchControls(), WieldMeshSceneNode::WieldMeshSceneNode(), addPostProcessing(), ClientMediaDownloader::addRemoteServer(), SingleMediaDownloader::addRemoteServer(), addUpscaling(), Server::AsyncRunStep(), RenderingEngine::autosaveScreensizeAndCo(), Game::connectToServer(), create3DStage(), createShadowRenderer(), Game::createSingleplayerServer(), dedicated_server_loop(), PlayerDatabaseFiles::deSerialize(), RenderingEngine::draw_load_screen(), drawItemStack(), ShaderSource::generateShader(), getFlag(), Server::getProtocolVersionMin(), Game::getServerContent(), guiScalingCache(), guiScalingResizeCached(), Server::handleChat(), Server::handleCommand_FirstSrp(), Server::handleCommand_ModChannelJoin(), Server::handleCommand_ModChannelLeave(), Server::handleCommand_ModChannelMsg(), Game::handleDigging(), Server::init(), ClientLauncher::init_args(), ClientLauncher::init_input(), GameUI::initFlags(), GenericCAO::initialize(), Client::initLocalMapSaving(), Game::initSound(), LuaSettings::l_get_bool(), ObjectRef::l_set_armor_groups(), LuaMinimap::l_show(), ServerMap::loadBlock(), loadGameConfAndInitWorld(), Client::loadMods(), main(), migrate_settings(), Game::nodePlacement(), ClientMap::onSettingChanged(), GUIFormSpecMenu::parseSize(), ShadowRenderer::preInit(), Game::processKeyInput(), Game::processPlayerInteraction(), PlayerSAO::punch(), PlayerSettings::readGlobalSettings(), Clouds::readSettings(), FontEngine::readSettings(), Game::readSettings(), TextureSettings::readSettings(), GUIKeyChangeMenu::regenerateGui(), GUIVolumeChange::regenerateGui(), ClientMap::renderMapShadows(), Address::Resolve(), ModConfiguration::resolveDependencies(), ClientLauncher::run(), Game::run(), GUIEngine::run(), run_dedicated_server(), TestSocket::runTests(), Server::SendActiveObjectRemoveAdd(), ServerList::sendAnnounce(), GUIScrollBar::setPosInterpolated(), RenderingEngine::settingChangedCallback(), Game::showPauseMenu(), sound_volume_control(), Game::startup(), ClientEnvironment::step(), GenericCAO::step(), Server::step(), TestAddress::testResolve(), Game::toggleAutoforward(), Game::toggleCinematic(), Game::toggleFast(), Game::toggleFog(), Game::toggleFreeMove(), Game::toggleMinimap(), Game::toggleNoClip(), Game::togglePitchMove(), Camera::update(), MeshUpdateManager::updateBlock(), Clouds::updateMesh(), Game::updatePointedThing(), and GenericCAO::updateTextures().
|
private |
References getParent(), m_mutex, and m_settings.
Referenced by get(), getGroup(), and TestSettings::testAllSettings().
bool Settings::getFlag | ( | const std::string & | name | ) | const |
References getBool().
Referenced by ClientLauncher::init_args(), main(), run_dedicated_server(), setup_log_params(), and MeshUpdateManager::updateBlock().
const FlagDesc * Settings::getFlagDescFallback | ( | const std::string & | name | ) | const |
References s_flags.
Referenced by getFlagStrNoEx(), LuaSettings::l_get_flags(), and setFlagStr().
u32 Settings::getFlagStr | ( | const std::string & | name, |
const FlagDesc * | flagdesc, | ||
u32 * | flagmask ) const |
References get(), getParent(), m_settings, readFlagString(), stoi, and U32_MAX.
Referenced by PlayerSAO::checkMovementCheat(), getFlagStrNoEx(), Server::handleCommand_Interact(), and TestSettings::testFlagDesc().
bool Settings::getFlagStrNoEx | ( | const std::string & | name, |
u32 & | val, | ||
const FlagDesc * | flagdesc ) const |
References getFlagDescFallback(), and getFlagStr().
Referenced by getNoiseParamsFromGroup(), and LuaSettings::l_get_flags().
float Settings::getFloat | ( | const std::string & | name | ) | const |
Referenced by Camera::Camera(), Environment::Environment(), GameGlobalShaderConstantSetter::GameGlobalShaderConstantSetter(), GUIModalMenu::GUIModalMenu(), JoystickController::JoystickController(), OffsetCameraStep::OffsetCameraStep(), RemotePlayer::RemotePlayer(), Server::Server(), ShadowRenderer::ShadowRenderer(), Sky::Sky(), TouchControls::TouchControls(), Server::acceptAuth(), Server::AsyncRunStep(), GUIFormSpecMenu::calculateImgsize(), PlayerSAO::checkMovementCheat(), ClientLauncher::config_guienv(), dedicated_server_loop(), PlayerDatabaseFiles::deSerialize(), RenderingEngine::draw_load_screen(), Hud::drawHotbar(), ShaderSource::generateShader(), RenderingEngine::getDisplayDensity(), getFloatNoEx(), RemoteClient::GetNextBlocks(), getSmoothLightCombined(), Server::handleChat(), Game::handleClientEvent_SetSky(), Server::handleCommand_Init2(), Server::init(), FontEngine::initFont(), FpsControl::limit(), GameGlobalShaderConstantSetter::onSettingsChange(), Game::processKeyInput(), Hud::readScalingSetting(), Game::readSettings(), GUIVolumeChange::regenerateGui(), ClientLauncher::run(), Game::run(), TestSAO::runTests(), Server::SendMovement(), sound_volume_control(), Client::step(), Game::step(), ServerEnvironment::step(), TestSettings::testAllSettings(), TouchControls::translateEvent(), Game::updateProfilers(), and Camera::updateViewingRange().
float Settings::getFloat | ( | const std::string & | name, |
float | min, | ||
float | max ) const |
bool Settings::getFloatNoEx | ( | const std::string & | name, |
float & | val ) const |
References getFloat().
Referenced by getNoiseParamsFromGroup().
Settings * Settings::getGroup | ( | const std::string & | name | ) | const |
References getEntry(), SettingsEntry::group, and SettingsEntry::is_group.
Referenced by getGroupNoEx(), and TestSettings::testAllSettings().
bool Settings::getGroupNoEx | ( | const std::string & | name, |
Settings *& | val ) const |
References getGroup().
Referenced by compare_settings(), getNoiseParamsFromGroup(), and TestSettings::testAllSettings().
|
inline |
References m_settingslayer.
Referenced by con::ConnectionSendThread::ConnectionSendThread(), GUIKeyChangeMenu::acceptInput(), FontEngine::initFont(), ModApiMapgen::l_set_noiseparams(), loadGameConfAndInitWorld(), TestMapSettingsManager::makeUserConfig(), setDefault(), TestSettings::testDefaults(), TestMapSettingsManager::testMapMetaSaveLoad(), TestMapSettingsManager::testMapSettingsManager(), and uninit_common().
|
static |
References g_hierarchy, and SettingsHierarchy::getLayer().
|
staticprivate |
Referenced by parseConfigLines(), and updateConfigObject().
std::vector< std::string > Settings::getNames | ( | ) | const |
References m_mutex, and m_settings.
Referenced by ModConfiguration::addModsFromConfig(), compare_settings(), LuaSettings::l_get_names(), and removeSecureSettings().
bool Settings::getNoEx | ( | const std::string & | name, |
std::string & | val ) const |
References get().
Referenced by compare_settings(), ServerMap::createDatabase(), MapSettingsManager::getMapSetting(), getNoiseParamsFromValue(), ServerEnvironment::init(), ServerEnvironment::openAuthDatabase(), Server::openModStorageDatabase(), and ServerEnvironment::openPlayerDatabase().
bool Settings::getNoiseParams | ( | const std::string & | name, |
NoiseParams & | np ) const |
References getNoiseParamsFromGroup(), getNoiseParamsFromValue(), and getParent().
Referenced by MapSettingsManager::getMapSettingNoiseParams(), ModApiMapgen::l_get_noiseparams(), LuaSettings::l_get_np_group(), and TestSettings::testAllSettings().
bool Settings::getNoiseParamsFromGroup | ( | const std::string & | name, |
NoiseParams & | np ) const |
References flagdesc_noiseparams, NoiseParams::flags, getFlagStrNoEx(), getFloatNoEx(), getGroupNoEx(), getS32NoEx(), getU16NoEx(), getV3FNoEx(), NoiseParams::lacunarity, NOISE_FLAG_DEFAULTS, NoiseParams::octaves, NoiseParams::offset, NoiseParams::persist, NoiseParams::scale, NoiseParams::seed, and NoiseParams::spread.
Referenced by getNoiseParams().
bool Settings::getNoiseParamsFromValue | ( | const std::string & | name, |
NoiseParams & | np ) const |
References getNoEx(), NoiseParams::lacunarity, BasicStrfnd< T >::next(), NoiseParams::octaves, NoiseParams::offset, NoiseParams::persist, NoiseParams::scale, NoiseParams::seed, NoiseParams::spread, stof, and stoi.
Referenced by getNoiseParams().
|
private |
References SettingsHierarchy::getParent(), m_hierarchy, and m_settingslayer.
Referenced by exists(), getEntry(), getFlagStr(), and getNoiseParams().
s16 Settings::getS16 | ( | const std::string & | name | ) | const |
Referenced by Hud::Hud(), ServerMap::ServerMap(), ShadowRenderer::ShadowRenderer(), Game::decreaseViewRange(), getS16NoEx(), Game::handleClientEvent_SetSky(), Game::increaseViewRange(), Server::SendActiveObjectRemoveAdd(), Server::SendAddParticleSpawner(), ServerList::sendAnnounce(), Server::SendBlockNoLock(), Client::sendChatMessage(), Server::SendSpawnParticle(), ParticleSpawner::step(), ServerEnvironment::step(), and TestSettings::testAllSettings().
bool Settings::getS16NoEx | ( | const std::string & | name, |
s16 & | val ) const |
References getS16().
Referenced by EmergeManager::EmergeManager().
s32 Settings::getS32 | ( | const std::string & | name | ) | const |
Referenced by GUIChatConsole::GUIChatConsole(), GUIFormSpecMenu::GUIFormSpecMenu(), Hud::Hud(), MeshUpdateManager::MeshUpdateManager(), ShadowRenderer::ShadowRenderer(), ServerEnvironment::clearObjects(), GUIEngine::downloadFile(), ShaderSource::generateShader(), getS32NoEx(), getSubgameSpec(), init_common(), ClientMediaDownloader::initialStep(), Client::makeScreenshot(), JoystickController::onJoystickConnect(), parseContentInfo(), parseModContents(), GUIFormSpecMenu::regenerateGui(), SingleMediaDownloader::startRemoteMediaTransfer(), ClientMediaDownloader::startRemoteMediaTransfers(), Client::step(), TestSettings::testAllSettings(), and ServerMap::transformLiquids().
bool Settings::getS32NoEx | ( | const std::string & | name, |
s32 & | val ) const |
References getS32().
Referenced by getNoiseParamsFromGroup().
u16 Settings::getU16 | ( | const std::string & | name | ) | const |
Referenced by Client::Client(), Database_Redis::Database_Redis(), GUIChatConsole::GUIChatConsole(), MeshUpdateWorkerThread::MeshUpdateWorkerThread(), RemotePlayer::RemotePlayer(), RenderingEngine::RenderingEngine(), TouchControls::TouchControls(), addPostProcessing(), create_default_layout(), PlayerDatabaseFiles::deSerialize(), Hud::drawBlockBounds(), game_configure_port(), ImageSource::generateImagePart(), ShaderSource::generateShader(), getDownscaleFactor(), Server::getProtocolVersionMin(), getU16NoEx(), Server::handleCommand_Init(), GameUI::init(), Server::init(), FontEngine::initFont(), ClientInterface::isUserLimitReached(), MyEventReceiver::OnEvent(), MapBlock::onObjectsActivation(), ClientMap::onSettingChanged(), Database_SQLite3::openDatabase(), Clouds::readSettings(), FontEngine::readSettings(), TextureSettings::readSettings(), Game::run(), GUIEngine::run(), MapBlock::saveStaticObject(), ServerList::sendAnnounce(), and ServerMap::transformLiquids().
bool Settings::getU16NoEx | ( | const std::string & | name, |
u16 & | val ) const |
References getU16().
Referenced by getNoiseParamsFromGroup(), ServerEnvironment::init(), and FontEngine::initFont().
u32 Settings::getU32 | ( | const std::string & | name | ) | const |
Referenced by EmergeManager::EmergeManager(), Environment::Environment(), ChatBackend::applySettings(), getU32NoEx(), Server::init(), ServerEnvironment::loadMeta(), and Server::SendBlocks().
bool Settings::getU32NoEx | ( | const std::string & | name, |
u32 & | val ) const |
References getU32().
Referenced by EmergeManager::EmergeManager().
u64 Settings::getU64 | ( | const std::string & | name | ) | const |
References from_string(), and get().
Referenced by getU64NoEx(), Server::init(), init_log_streams(), and ServerEnvironment::loadMeta().
bool Settings::getU64NoEx | ( | const std::string & | name, |
u64 & | val ) const |
v2f Settings::getV2F | ( | const std::string & | name | ) | const |
References get(), BasicStrfnd< T >::next(), and stof.
Referenced by getV2FNoEx().
bool Settings::getV2FNoEx | ( | const std::string & | name, |
v2f & | val ) const |
v3f Settings::getV3F | ( | const std::string & | name | ) | const |
References get(), and str_to_v3f().
Referenced by GUIChatConsole::GUIChatConsole(), Hud::Hud(), PlayerDatabaseFiles::deSerialize(), getV3FNoEx(), GUIFormSpecMenu::regenerateGui(), and TestSettings::testAllSettings().
bool Settings::getV3FNoEx | ( | const std::string & | name, |
v3f & | val ) const |
References getV3F().
Referenced by Server::findSpawnPos(), and getNoiseParamsFromGroup().
References clearNoLock(), FATAL_ERROR_IF, m_callbacks, m_hierarchy, m_mutex, and m_settings.
bool Settings::parseCommandLine | ( | int | argc, |
char * | argv[], | ||
const std::map< std::string, ValueSpec > & | allowed_options ) |
References allowed_options, errorstream, itos(), set(), and VALUETYPE_FLAG.
Referenced by get_cmdline_opts().
bool Settings::parseConfigLines | ( | std::istream & | is | ) |
References Settings(), getMultiline(), m_end_tag, m_mutex, m_settings, parseConfigLines(), parseConfigObject(), SPE_COMMENT, SPE_END, SPE_GROUP, SPE_INVALID, SPE_KVPAIR, SPE_MULTILINE, and SPE_NONE.
Referenced by PlayerDatabaseFiles::deSerialize(), MapSettingsManager::loadMapMeta(), ServerEnvironment::loadMeta(), parseConfigLines(), readConfigFile(), and TestSettings::testAllSettings().
|
private |
References m_end_tag, SPE_COMMENT, SPE_END, SPE_GROUP, SPE_INVALID, SPE_KVPAIR, SPE_MULTILINE, SPE_NONE, and trim().
Referenced by parseConfigLines(), and updateConfigObject().
|
staticprivate |
References SettingsEntry::group, SettingsEntry::is_group, SettingsEntry::value, and writeLines().
Referenced by updateConfigObject(), and writeLines().
bool Settings::readConfigFile | ( | const char * | filename | ) |
References parseConfigLines().
Referenced by LuaSettings::LuaSettings(), ServerMap::ServerMap(), ModConfiguration::addModsFromConfig(), getAvailableGameIds(), getSubgameSpec(), getWorldGameId(), getWorldName(), ServerEnvironment::init(), loadGameConfAndInitWorld(), migrate_map_database(), ServerEnvironment::migrateAuthDatabase(), Server::migrateModStorageDatabase(), ServerEnvironment::migratePlayersDatabase(), Server::openModStorageDatabase(), parseContentInfo(), parseModContents(), read_config_file(), and recompress_map_database().
void Settings::registerChangedCallback | ( | const std::string & | name, |
SettingsChangedCallback | cbf, | ||
void * | userdata = NULL ) |
References m_callback_mutex, and m_callbacks.
Referenced by ClientMap::ClientMap(), Clouds::Clouds(), FontEngine::FontEngine(), Game::Game(), GameGlobalShaderConstantSetter::GameGlobalShaderConstantSetter(), GUIEngine::GUIEngine(), Hud::Hud(), RenderingEngine::RenderingEngine(), PlayerSettings::registerSettingsCallback(), and ClientLauncher::run().
bool Settings::remove | ( | const std::string & | name | ) |
References doCallbacks(), m_mutex, and m_settings.
Referenced by GUIKeyChangeMenu::acceptInput(), ModApiMainMenu::l_create_world(), LuaSettings::l_remove(), migrate_settings(), and removeSecureSettings().
void Settings::removeSecureSettings | ( | ) |
References errorstream, getNames(), and remove().
Referenced by loadGameConfAndInitWorld().
bool Settings::set | ( | const std::string & | name, |
const std::string & | value ) |
References doCallbacks(), and setEntry().
Referenced by ServerMap::ServerMap(), GUIKeyChangeMenu::acceptInput(), Game::decreaseViewRange(), get_env_opts(), Game::increaseViewRange(), ServerEnvironment::init(), ModApiMainMenu::l_create_world(), LuaSettings::l_set(), ClientLauncher::launch_game(), loadGameConfAndInitWorld(), TestMapSettingsManager::makeUserConfig(), migrate_map_database(), migrate_settings(), ServerEnvironment::migrateAuthDatabase(), Server::migrateModStorageDatabase(), ServerEnvironment::migratePlayersDatabase(), parseCommandLine(), ServerEnvironment::saveMeta(), PlayerDatabaseFiles::serialize(), setBool(), setFlagStr(), setFloat(), MapSettingsManager::setMapSetting(), setS16(), setS32(), setU16(), setU64(), setV2F(), setV3F(), TestSettings::testAllSettings(), TestServerModManager::testCreation(), TestSettings::testDefaults(), TestSettings::testFlagDesc(), TestMapSettingsManager::testMapMetaSaveLoad(), Game::toggleAutoforward(), Game::toggleCinematic(), Game::toggleFast(), Game::toggleFreeMove(), Game::toggleNoClip(), and Game::togglePitchMove().
bool Settings::setBool | ( | const std::string & | name, |
bool | value ) |
References set().
Referenced by GUIKeyChangeMenu::acceptInput(), ModConfiguration::addModsFromConfig(), RenderingEngine::autosaveScreensizeAndCo(), createShadowRenderer(), LuaSettings::l_set_bool(), loadGameConfAndInitWorld(), migrate_settings(), GUIVolumeChange::OnEvent(), MyEventReceiver::OnEvent(), Game::processKeyInput(), Minimap::setMinimapShape(), Game::toggleFog(), and Minimap::toggleMinimapShape().
void Settings::setDefault | ( | const std::string & | name, |
const FlagDesc * | flagdesc, | ||
u32 | flags ) |
References s_flags, setDefault(), U32_MAX, and writeFlagString().
bool Settings::setDefault | ( | const std::string & | name, |
const std::string & | value ) |
References FATAL_ERROR_IF, g_hierarchy, getLayer(), m_hierarchy, and SL_DEFAULTS.
Referenced by setDefault(), and TestSettings::testFlagDesc().
bool Settings::setEntry | ( | const std::string & | name, |
const void * | entry, | ||
bool | set_group ) |
References checkNameValid(), checkValueValid(), SettingsEntry::group, SettingsEntry::is_group, m_end_tag, m_mutex, m_settings, and SettingsEntry::value.
Referenced by set(), setGroup(), and setNoiseParams().
bool Settings::setFlagStr | ( | const std::string & | name, |
u32 | flags, | ||
const FlagDesc * | flagdesc = nullptr, | ||
u32 | flagmask = U32_MAX ) |
References getFlagDescFallback(), set(), and writeFlagString().
Referenced by migrate_settings(), and setNoiseParams().
bool Settings::setFloat | ( | const std::string & | name, |
float | value ) |
Referenced by GUIVolumeChange::OnEvent(), Game::processKeyInput(), PlayerDatabaseFiles::serialize(), setNoiseParams(), sound_volume_control(), and TestSettings::testAllSettings().
bool Settings::setGroup | ( | const std::string & | name, |
const Settings & | group ) |
References Settings(), and setEntry().
Referenced by TestSettings::testAllSettings().
bool Settings::setNoiseParams | ( | const std::string & | name, |
const NoiseParams & | np ) |
References Settings(), flagdesc_noiseparams, NoiseParams::flags, NoiseParams::lacunarity, NoiseParams::octaves, NoiseParams::offset, NoiseParams::persist, NoiseParams::scale, NoiseParams::seed, setEntry(), setFlagStr(), setFloat(), setS32(), setU16(), setV3F(), and NoiseParams::spread.
Referenced by LuaSettings::l_set_np_group(), MapSettingsManager::setMapSettingNoiseParams(), and TestSettings::testAllSettings().
bool Settings::setS16 | ( | const std::string & | name, |
s16 | value ) |
Referenced by TestSettings::testAllSettings().
bool Settings::setS32 | ( | const std::string & | name, |
s32 | value ) |
Referenced by PlayerDatabaseFiles::serialize(), and setNoiseParams().
bool Settings::setU16 | ( | const std::string & | name, |
u16 | value ) |
Referenced by RenderingEngine::autosaveScreensizeAndCo(), MyEventReceiver::OnEvent(), PlayerDatabaseFiles::serialize(), and setNoiseParams().
bool Settings::setU64 | ( | const std::string & | name, |
u64 | value ) |
References set().
Referenced by ServerEnvironment::saveMeta().
bool Settings::setV2F | ( | const std::string & | name, |
v2f | value ) |
bool Settings::setV3F | ( | const std::string & | name, |
v3f | value ) |
References set().
Referenced by PlayerDatabaseFiles::serialize(), setNoiseParams(), and TestSettings::testAllSettings().
bool Settings::updateConfigFile | ( | const char * | filename | ) |
References m_mutex, fs::safeWriteToFile(), and updateConfigObject().
Referenced by ServerMap::ServerMap(), ModConfiguration::addModsFromConfig(), ServerEnvironment::init(), Java_net_minetest_minetest_GameActivity_saveSettings(), LuaSettings::l_write(), loadGameConfAndInitWorld(), main(), ClientLauncher::main_menu(), migrate_map_database(), ServerEnvironment::migrateAuthDatabase(), Server::migrateModStorageDatabase(), ServerEnvironment::migratePlayersDatabase(), ClientLauncher::run(), MapSettingsManager::saveMapMeta(), and TestServerModManager::testCreation().
|
private |
References getMultiline(), m_end_tag, m_settings, parseConfigObject(), printEntry(), sanity_check, SPE_END, SPE_GROUP, SPE_KVPAIR, SPE_MULTILINE, and updateConfigObject().
Referenced by TestSettings::testAllSettings(), updateConfigFile(), and updateConfigObject().
void Settings::writeLines | ( | std::ostream & | os, |
u32 | tab_depth = 0 ) const |
References m_end_tag, m_mutex, m_settings, and printEntry().
Referenced by printEntry(), ServerEnvironment::saveMeta(), and PlayerDatabaseFiles::serialize().
|
friend |
|
friend |
|
mutableprivate |
Referenced by deregisterAllChangedCallbacks(), doCallbacks(), and registerChangedCallback().
|
private |
Referenced by deregisterAllChangedCallbacks(), doCallbacks(), operator=(), and registerChangedCallback().
|
private |
Referenced by parseConfigLines(), parseConfigObject(), setEntry(), updateConfigObject(), and writeLines().
|
private |
Referenced by Settings(), ~Settings(), getParent(), operator=(), and setDefault().
|
mutableprivate |
Referenced by ~Settings(), existsLocal(), getEntry(), getNames(), operator=(), parseConfigLines(), remove(), setEntry(), updateConfigFile(), and writeLines().
|
private |
Referenced by clearNoLock(), existsLocal(), getEntry(), getFlagStr(), getNames(), operator=(), parseConfigLines(), remove(), setEntry(), updateConfigObject(), and writeLines().
|
private |
Referenced by Settings(), ~Settings(), getLayer(), and getParent().
|
staticprivate |
Referenced by getFlagDescFallback(), and setDefault().