aboutsummaryrefslogtreecommitdiff
path: root/src/settings.cpp
AgeCommit message (Collapse)Author
2022-07-09Enforce limits of settings that could cause buggy behaviour (#12450)SmallJoker
Enforces the setting value bounds that are currently only limited by the GUI (settingtypes.txt).
2022-01-09Mainmenu game-related changes (#11887)sfan5
fixes: * Switching between games does not immediately hide creative mode / damage buttons if so specified * World creation menu has a game selection list even though the menu already provides a gamebar * Showing gameid in world list is unnecessary * Choice of mapgen parameters in menu persists between games (and was half-broken)
2021-12-05Fix various code & correctness issues (#11815)sfan5
2021-10-12Remove a few unused functions reported by callcatcher (#11658)SmallJoker
2021-09-11Make sure relevant std::stringstreams are set to binarysfan5
2021-08-17Fix inconsistent integer comparison warningsSmallJoker
2021-07-31Fix /emergeblocks crashing in debug builds (#11461)Wuzzy
The reason for the bug was an u16 overflow, thus failing the assert. This only happened in Debug build but not in Release builds.
2021-06-23Rework Settings to support arbitrary hierarchies (#11352)sfan5
2021-04-05Reserve vectors before pushing and other code quality changes (#11161)sfan5
2021-01-29Settings: Purge getDefault, clean FontEngineSmallJoker
2021-01-29Settings: Proper priority hierarchySmallJoker
Remove old defaults system Introduce priority-based fallback list Use new functions for map_meta special functions Change groups to use end tags Unittest changes: * Adapt unittest to the new code * Compare Settings objects
2020-10-06Prevent games from setting secure settings (#10460)rubenwardy
2020-10-01Settings: Remove unused functionsSmallJoker
Make Settings-internal functions private
2020-09-22Settings: Fix unittest memory leak, change input typesSmallJoker
2020-09-21Settings: Fix crash on exit due to group double-freeSmallJoker
2020-02-17Settings: Fix game minetest.conf flags overriding defaults (#9404)SmallJoker
The game minetest.conf flags directly overwrote the global minetest.conf default values, resulting in unwanted erased mapgen flags. * Fix set_mapgen_setting
2020-01-25Settings: Add get_flags API for mapgen flags (mg_flags, mgv6_spflags, ...) ↵SmallJoker
(#9284) Unified flags handling in C++ and Lua Settings API -> Reading only, for now. Writing can be implemented later, if needed. API function to read the currently active flags -> was impossible from Lua Co-authored-by: Wuzzy <wuzzy2@mail.ru>
2019-09-18Settings: Prevent mutex deadlock in remove() (#7803)SmallJoker
2019-06-10Settings: Disallow space characters entirelySmallJoker
Lua API: > Setting names can't contain whitespace or any of ="{}#
2019-01-19Advanced settings noiseparams: Remove '}' left in .confSmallJoker
Previously, when editing noiseparams then restoring them to the default, the final '}' was not removed from minetest.conf.
2018-09-30Remove settings properly (#7676)SmallJoker
2017-11-08Fix issue Minetest crash when custom font path is not existMuhammad Rifqi Priyo Susanto
We try to use default fallback for both mono and main font when custom font path is not exist. This way, if Minetest is not corrupted, we could avoid crash.
2017-08-19Code modernization: src/p*, src/q*, src/r*, src/s* (partial) (#6282)Loïc Blot
* Code modernization: src/p*, src/q*, src/r*, src/s* (partial) * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Spelling: vertice -> vertex
2017-07-18[CSM] Add flavour limits controlled by server (#5930)Loïc Blot
* [CSM] Add flavour limits controlled by server Server send flavour limits to client permitting to disable or limit some Lua calls * Add limits for reading nodedefs and itemdefs * flavour: Add lookup node limits * Merge get_node_or_nil into get_node. Sending fake node doesn't make sense in CSM, just return nil if node is not available for any reason * Add node range customization when noderange flavour is enabled (default 8 nodes) * Limit nodes range & disable chat message sending by default * Bump protocol version
2017-03-22Some performance optimizations (#5424)Loïc Blot
* Some performance optimizations This is globally removing some memory useless copy * use a const ref return on std::string Settings::get to prevent data copy on getters which doesn't need to copy it * pass some stack created strings to static const as they are not modified anywhere * Camera: return nametags per const ref instead of a list pointer, we only need to read it * INodeDefManager: getAll should be a result ref writer instead of a return copy * INodeDefManager: getAlias should return a const std::string ref * Minimap: unroll a Scolor creation in blitMinimapPixersToImageRadar to prvent many variable construct/destruct which are unneeded (we rewrite the content in the loop) * CNodeDefManager::updateAliases: prevent a idef getall copy * Profiler: constness * rollback_interface: create real_name later, and use const ref * MapBlockMesh updateFastFaceRow: unroll TileSpec next_tile, which has a cost of 1.8% CPU due to variable allocation/destruction, * MapBlockMesh updateFastFaceRow: copy next_tile to tile only if it's a different tilespec * MapBlockMesh updateFastFaceRow: use memcpy to copy next_lights to lights to do it in a single cpu operation
2016-10-05Replace various std::map with UNORDERED_MAP + various cleanupsLoic Blot
This is part 2 for 5f084cd98d7b3326b51320455364337539710efd Other improvements: * Use the defined ItemGroupList when used * make Client::checkPrivilege const * inline some trivial functions * Add ActiveObjectMap typedef * Add SettingsEntries typedef
2016-06-11Settings: Clean up settings changed callback codekwolekr
2016-03-19Clean up StrfndShadowNinja
Changes: * Fix indentation. * Pass strings by const reference. * Merge Strfnd and WStrfnd into one class instead of copying them. * Remove trailing spaces. * Fix variable names. * Move to util. * Other miscellaneous style fixes.
2016-01-19Fix Settings::remove() always returning trueKahrl
2015-08-25Change i++ to ++iDavid Jones
2015-08-23Clean up threadingShadowNinja
* Rename everything. * Strip J prefix. * Change UpperCamelCase functions to lowerCamelCase. * Remove global (!) semaphore count mutex on OSX. * Remove semaphore count getter (unused, unsafe, depended on internal API functions on Windows, and used a hack on OSX). * Add `Atomic<type>`. * Make `Thread` handle thread names. * Add support for C++11 multi-threading. * Combine pthread and win32 sources. * Remove `ThreadStarted` (unused, unneeded). * Move some includes from the headers to the sources. * Move all of `Event` into its header (allows inlining with no new includes). * Make `Event` use `Semaphore` (except on Windows). * Move some porting functions into `Thread`. * Integrate logging with `Thread`. * Add threading test.
2015-05-16Add mod securityShadowNinja
Due to compatibility concerns, this is temporarily disabled.
2015-04-01Move globals from main.cpp to more sane locationsCraig Robbins
Move debug streams to log.cpp|h Move GUI-related globals to clientlauncher Move g_settings and g_settings_path to settings.cpp|h Move g_menuclouds to clouds.cpp|h Move g_profiler to profiler.cpp|h
2015-03-18Fix game minetest.conf default settingsest31
This was a regression introduced by f6e4c5d9cf459e8278a76a2beaee59732e841458 .
2015-03-07For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins
NDEBUG is defined), replace those usages with persistent alternatives
2015-01-25Settings fixes Make the GameGlobalShaderConstantSetter use the settings ↵gregorycu
callback (8% perf improvement in game loop) Ensure variable is set Ensure settings callback is threadsafe
2015-01-25Revert "Make the GameGlobalShaderConstantSetter use the settings callback ↵Craig Robbins
(8% perf improvement in game loop)" This reverts commit a555e2d9b0ccee452996381a44677b8bec210036.
2015-01-23Make the GameGlobalShaderConstantSetter use the settings callback (8% perf ↵gregorycu
improvement in game loop) Amend the settings callback to support userdata
2014-12-12Settings: Fix invalid memory access when setting not found in working memkwolekr
2014-12-12Settings: Fail on invalid sequence and throw exception for LuaSettingskwolekr
2014-12-11Settings: Sanitize value for multiline terminator tokenskwolekr
2014-12-10Add support for lacunarity in legacy NoiseParams string formatkwolekr
2014-12-09Settings: Sanitize setting name everywhere, not just LuaSettingskwolekr
2014-12-09Settings: Make setting entry group and values mutually exclusivekwolekr
This greatly reduces the complexity of Settings code. Additionally, several memory leaks were fixed.
2014-12-07Add flags and lacunarity as new noise parameterskwolekr
Add 'absolute value' option to noise map functions Extend persistence modulation to 3D noise Extend 'eased' option to noise2d_perlin* functions Some noise.cpp formatting fixups
2014-12-06Close settings files and save them correctlySmallJoker
2014-12-04Settings: Various setting group fixes and enhancementskwolekr
- Remove blank setting values when setting has a group - Pair setting values with groups in file when possible - Preserve user-set whitespace in setting objects - Delete setting value when setting NoiseParams group - Delete overwritten groups outside of lock
2014-12-02Settings: Fix getNoiseParamsFromValue()kwolekr
2014-12-02Use setting groups for NoiseParamskwolekr
Add format example to minetest.conf.example Add Settings::setU16() Throw exception on attempted access of NULL settings groups
2014-12-01Fix settings callback "call" lost on rebasesapier