aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_util.cpp
AgeCommit message (Collapse)Author
2020-05-22Check for valid base64 before decoding (#9904)Lejo1
2020-04-22Fix configuration caching in log_deprecated (#9697)HybridDog
* Fix configuration caching in log_deprecated The configured variable was never set to true. I've set the variables to thread_local because the configuration should be reloaded after reentering the world from mainmenu.
2020-02-23Refactor Script API's log_deprecatedsfan5
2018-06-30Modernize lua read (part 2 & 3): C++ templating assurance (#7410)Loïc Blot
* Modernize lua read (part 2 & 3): C++ templating assurance Implement the boolean reader Implement the string reader Also remove unused & unimplemented script_error_handler Add a reader with default value
2018-06-04Modernize lua read (part 1): C++ templating insurance (#7394)Loïc Blot
* Modernize lua read (part 1): C++ templating assurance Implement the float reader
2018-05-31Fix isNan on setYaw Lua call (#7380)Loïc Blot
* Fix isNan on setYaw Lua call
2018-01-03Tool.cpp/.h, lua_api/l_util.cpp: Tidy up code and remove dead codeHybrid Dog
2017-11-08Add minetest.safe_write_file() to script APIsfan5
2017-10-30Add sha1 to lua utils. (#6563)Rob Blanckaert
2017-09-26Update JsonCPP to 1.8.3 (#6466)Loïc Blot
* Update JsonCPP to 1.8.3 * Fix deprecated functions Json::FastWriter, Json::StyledWriter and Json::Reader are marked deprecated since 1.1 and are deprecated in 0.8 but not shown at compilation time. Use new methods to serialize/deserialize
2017-08-19Code modernization: subfolders (#6283)Loïc Blot
* Code modernization: subfolders Modernize various code on subfolders client, network, script, threading, unittests, util * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Make connection.cpp readable in a pointed place + typo
2017-06-30Create a filesystem abstraction layer for CSM and only allow accessing files ↵red-001
that are scanned into it. (#5965) * Load client-side mods into memory before executing them. This removes the remaining filesystem access that client-sided mods had and it will hopefully make then more secure. * Lua Virtual filesystem: don't load the files into memory just scan the filenames into memory. * Fix the issues with backtrace * fix most of the issues * fix code style. * add a comment
2017-06-04C++11 patchset 2: remove util/cpp11.h and util/cpp11_container.h (#5821)Loïc Blot
2017-05-06Use a settings object for the main settingsShadowNinja
This unifies the settings APIs. This also unifies the sync and async registration APIs, since the async registration API did not support adding non-functions to the API table.
2017-03-13[CSM] storage + fixesLoic Blot
2017-03-13[CSM] sound_play & sound_stop support + client_lua_api doc (#5096)Loïc Blot
* squashed: CSM: Implement register_globalstep * Re-use fatal error mechanism from server to disconnect client on CSM error * Little client functions cleanups * squashed: CSM: add core.after function * core.after is shared code between client & server * ModApiUtil get_us_time feature enabled for client
2017-03-13[CSM] Add method that display chat to client-sided lua. (#5089) (#5091)red-001
* squashed: [Client-sided scripting] Don't register functions that don't work. (#5091)
2016-12-28Dont compare short with bool (#4963)adrido
Fixes a compiler warning on MSVC
2016-12-20Mod security: Allow read-only access to all mod pathsShadowNinja
2016-10-31Add version APIShadowNinja
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-08-10Fixes for compiling with a newer (system) jsoncpp (#4429)Rogier-5
* Move included json code to jsoncpp subdirectory This is needed to avoid having to specify the minetest src directory as a system include when fixing the json includes. * Fix json includes They used "", so that the compiler searches the project's directory first. The result was that when compiling with a system jsoncpp, the project's own version of json.h was still included, instead of the system version. The includes now use <>, so a system location, or one specified with '-Ilocation' is searched only. * Fix for jsoncpp deprecated function warning When compiling with a newer version of jsoncpp (and ENABLE_SYSTEM_JSONCPP=true), jsoncpp emits a warning about a deprecated function that minetest uses.
2016-08-04Fix l_request_insecure_environment not ignoring all whitespace (#4395)Dorian Wouters
l_request_insecure_environment didn't ignore all whitespace in the secure.trusted_mods config option. Replaces std::remove with std::remove_if and the isspace function.
2016-05-30Add minetest.check_password_entry callbackest31
Gives a convenient way to check a player's password. This entirely bypasses the SRP protocol, so should be used with great care. This function is not intended to be used in-game, but solely by external protocols, where no authentication of the minetest engine is provided, and also only for protocols, in which the user already gives the server the plaintext password. Examples for good use are the classical http form, or irc, an example for a bad use is a password change dialog inside formspec. Users should be aware that they lose the advantages of the SRP protocol if they enter their passwords for servers outside the normal entry box, like in in-game formspec menus, or through irc /msg s, This patch also fixes an auth.h mistake which has mixed up the order of params inside the decode_srp_verifier_and_salt function. Zeno-: Added errorstream message for invalid format when I committed
2016-05-27Add base64 encoding and decoding to the lua api. (#3919)red-001
2016-03-15Much better API for auth.{cpp, h}est31
* No function overloading * Adhere coding style and with method names following lowercase_underscore_style * Use std::string in external API, handling these is much more fun
2016-03-07Move AreaStore to utilShadowNinja
2016-03-07Use LuaErrors in security check macrosShadowNinja
Throwing a LuaError calls destructors as it propagates up the stack, wheres lua_error just executes a longjmp.
2016-03-03Fix main menu being unable to set secure settingsShadowNinja
2016-02-26Fix minetest.request_insecure_environment() always returning nilJeija
Fixes #3765
2016-02-19Ignore spaces in secure.trusted_mods settingJeija
2016-02-19Require request_insecure_environment to be called from the mod's main scopeShadowNinja
Previously you could steal a secure environment from a trusted mod by wrapping request_insecure_environment with some code like this: local rie_cp = minetest.request_insecure_environment local stolen_ie function minetest.request_insecure_environment() local ie = rie_cp() stolen_ie = stolen_ie or ie return ie end
2016-01-28Don't print whole json data buffer to errorstream on errorest31
`errorstream` must not be overly verbose as clientside it is directly printed onto the ingame chat window. These days, the serverlist can contain > 200k bytes, so better print it to warningstream if the data buffer is too long.
2015-10-26SAPI: Move core.get_us_time() to Util modulekwolekr
2015-10-25SAPI: Mark all Lua API functions requiring envlockkwolekr
2015-10-26Correct comment in l_util.cppest31
Remove outdated loglevel list from a l_util.cpp comment, and rather point to the updated code.
2015-10-14Refactor loggingShadowNinja
- Add warning log level - Change debug_log_level setting to enumeration string - Map Irrlicht log events to MT log events - Encapsulate log_* functions and global variables into a class, Logger - Unify dstream with standard logging mechanism - Unify core.debug() with standard core.log() script API
2015-08-27Use numeric indices and raw table access with LUA_REGISTRYINDEXKahrl
2015-07-27Add AreaStore data structureest31
2015-05-16Add core.get_dir_listShadowNinja
2015-05-16Add core.request_insecure_environment()ShadowNinja
2015-05-16Add core.mkdirShadowNinja
2015-05-16Add mod securityShadowNinja
Due to compatibility concerns, this is temporarily disabled.
2015-05-11Make early protocol auth mechanism generic, and add SRPest31
Adds everything needed for SRP (and everything works too), but still deactivated, as protocol v25 init packets aren't final yet. Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25 inside networkprotocol.h.
2015-04-17Refactor around translatePasswordest31
Change types for passed password from wstring to string, which removes converting back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary, closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for translatePassword passed as const reference.
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
2014-09-21Split settings into seperate source and header filesShadowNinja
This also cleans up settings a bit
2014-09-20Add compression APIShadowNinja
2014-05-15Make print() NUL-safeShadowNinja
2014-05-07Organize builtin into subdirectoriesShadowNinja