aboutsummaryrefslogtreecommitdiff
path: root/src/script
AgeCommit message (Collapse)Author
2016-03-07Move AreaStore container selection logic into getOptimalImplementationShadowNinja
2016-03-07Move AreaStore to utilShadowNinja
2016-03-07Simplify AreaStore ID managementShadowNinja
2016-03-07s_env.{cpp, h} cleanupsest31
* Replace string by-val passing with const reference * Fix code style * Remove redundant `int table` definition and indentation level
2016-03-07Add minetest.register_lbm() to run code on block load onlyest31
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-03Require minetest.request_http_api to be called from the mod's main scopeJeija
Fixes #3764
2016-03-03Fix main menu being unable to set secure settingsShadowNinja
2016-03-03Remove debug.getupvalue from the Lua sandbox whitelistShadowNinja
This function could be used to steal insecure environments from trusted mods.
2016-02-26Fix minetest.request_insecure_environment() always returning nilJeija
Fixes #3765
2016-02-22Add Lua interface to HTTPFetchRequestJeija
This allows mods to perform both asynchronous and synchronous HTTP requests. Mods are only granted access to HTTP APIs if either mod security is disabled or if they are whitelisted in any of the the secure.http_mods and secure.trusted_mods settings. Adds httpfetch_caller_alloc_secure to generate random, non-predictable caller IDs so that lua mods cannot spy on each others HTTP queries.
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-02-11v2d & aabbox3d<f32> & sky cleanupsnerzhul
* Sky: rename Box => m_box and inline getBoundingBox * Uniformize aabbox3d<f32> to aabb3f
2016-02-11Add '/clearobjects quick'Kahrl
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.
2016-01-23Fix C++11 compilabilityest31
Previous commits broke it... :(
2016-01-20Allow per-tiles culling.Auke Kok
Backface culling is enabled by default for all tiles, as this is how the lua parser initializes each tiledef. We revert to always using the value from the tiledef since it is always read and serialized. Mods that wish to enable culling for e.g. mesh nodes, now can specify the following to enable backface culling: tiles = {{ name = "tex.png", backface_culling = true }}, Note the double '{' and use of 'name' key here! In the same fashion, backface_culling can be disabled for any node now. I've tested this against the new door models and this properly allows me to disable culling per node. I've also tested this against my crops mod which uses mesh nodes where culling needs to be disabled, and tested also with plantlike drawtype nodes where we want this to continue to be disabled. No default setting has changed. The defaults are just migrated from nodedef.cpp to c_content.cpp.
2016-01-18Show infotext with description for item entitiesRealBadAngel
2016-01-15Make ItemStack:set_count(0) clear the item stacksfan5
fixes minetest/minetest_game#786
2016-01-07Liquids: Flow into and destroy 'floodable' nodesparamat
Add new node property 'floodable', default false Define "air" as floodable = true in C++ and lua
2015-12-29Revert "Add support for using arbitrary meshes as items"Sapier
This reverts commit 91bafceee6606fab79db1bde4cba01b84fed65c7. Reverted due to missinterpretation of agreement, obvious dislike and me not interested in doing fights for feature I don't actually need
2015-12-29Add support for using arbitrary meshes as itemsSapier
2015-12-21Fix lua object:get_properties() being brokenSapier
2015-12-20Fix missing popest31
Previous commit 70ea5d552e283bd5bce3278cbf3819bd87ba2602 "Add support for limiting rotation of automatic face movement dir entitys" by sapier has broken minetest's feature to open worlds. This was due to a missing stack pop operation. Thanks to @oleastre for reporting this bug and suggesting the fix.
2015-12-19Add support for limiting rotation of automatic face movement dir entitysSapier
2015-12-15Add option to give every object a nametagBlockMen
or change the nametag text of players
2015-12-07Fix threshold typeest31
Fix the type of the threshold value for mapgen. The commit a78dd7f2b6b0e1fefdbaa1ae21b722dd4459e4f4 "Fix spelling of noise_threshold" has changed it to be read as int, but it can have non-integral values too. Thanks to @kwolekr for pointing this out.
2015-12-07Mapgen: Add propagate_shadow bool to calcLightingparamat
To terminate unwanted shadows from floatlands or realms above Also add to LuaVoxelManip calc_lighting for use in mapgen mods Remove the 2 argument calcLighting, mapgens now use the 5 argument form to specify the volumes for propagateSunlight and spreadLight In mgsinglenode replace calcLighting with setLighting and clean-up use of tabs and spaces
2015-12-06Fix spelling of noise_thresholdJun Zhang
2015-12-02Add on_secondary_use when right clicking an item in the airAlex Ford
2015-11-08Add LuaSecureRandomest31
2015-11-07Add support for audio feedback if placing node failedBlockMen
2015-11-06Add server side ncurses terminalest31
This adds a chat console the server owner can use for administration or to talk with players. It runs in its own thread, which makes the user interface immune to the server's lag, behaving just like a client, except timeout. As it uses the same console code as the f10 console, things like nick completion or a scroll buffer basically come for free. The terminal itself is written in a general way so that adding a client version later on is just about implementing an interface. Fatal errors are printed after the console exists and the ncurses terminal buffer gets cleaned up with endwin(), so that the error still remains visible. The server owner can chose their username their entered text will have in chat and where players can send PMs to. Once the username is secured with a password to prevent anybody to take over the server, the owner can execute admin tasks over the console. This change includes a contribution by @kahrl who has improved ncurses library detection.
2015-11-05Schematics: Add core.place_schematic_on_vmanip APIkwolekr
Fix memory leak in minetest.place_schematic Slightly refactor Schematic code
2015-11-02Add callback parameter for core.emerge_area()kwolekr
2015-11-01Fix Lua scripting synchronizationkwolekr
For several years now, the lua script lock has been completely broken. This commit fixes the main issue (creation of a temporary rather than scoped object), and fixes a subsequent deadlock issue caused by nested script API calls by adding support for recursive mutexes.
2015-10-31Fix server crashing on Lua errorsShadowNinja
Previously, the server called FATAL_ERROR when a Lua error occured. This caused a (mostly useless) core dump. The server now simply throws an exception, which is caught and printed before exiting with a non-zero return value. This also fixes a number of instances where errors were logged multiple times.
2015-10-26SAPI: Fix seed parameter truncation for LuaPseudoRandom constructorkwolekr
Also fix a potential seed truncation issue on platforms where the range of ptrdiff_t (the underlying type of lua_Integer) is too small.
2015-10-26SAPI: Move core.get_us_time() to Util modulekwolekr
2015-10-26Remove some abort() callsest31
abort() doesn't benefit from the high level abstractions from FATAL_ERROR.
2015-10-25SAPI: Throw runtime error instead of if l_get_mapgen_object called in ↵kwolekr
incorrect thread
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-25Add option to disable backface culling for modelsBlockMen
- Disabled by default (except players) - Fixes #2984
2015-10-18ABMs: Make catch-up behaviour optionalparamat
Default is true for backwards compatibility Update lua_api.txt
2015-10-18Remove wstrgettextest31
Everywhere where wstrgettext was used, its output was converted back to utf8. As wstrgettext internally converts the return value from utf8 to wstring, it has been a waste. Remove the function, and use strgettext instead.
2015-10-17Fix crash regression when invsize formspec gets usedest31
The invsize formspec element is outdated. Even though, it is still supported, only a deprecation warning is shown, introduced by commit [1]. The lua context passed to the log_deprecated method added by commit [1] is NULL for the invsize deprecation warning, as its run on the client and not the server. Commit [1] has removed checks for NULL inside the log_deprecated method, resulting in a crash when a formspec with an invsize element is parsed. This commit puts the check back. Fixes #3260. Referenced commits: [1]: b5acec0a3c5701c53854ff7afdf4008863e6e8df "Add proper lua api deprecated handling" [2]: 7b8d372947aae232ddf598155e972bb4dda157a "Use warningstream for deprecated field messages and refactor log_deprecated"
2015-10-15Use warningstream for deprecated field messages and refactor log_deprecatedShadowNinja
2015-10-14Rename macros with two leading underscoresShadowNinja
These names are reserved for the compiler/library implementations.