1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00

Add core.request_insecure_environment()

This commit is contained in:
ShadowNinja 2014-09-09 21:52:07 -04:00
parent 05ab9973f9
commit 6c06330daf
5 changed files with 46 additions and 4 deletions

View file

@ -2290,13 +2290,20 @@ These functions return the leftover itemstack.
* `minetest.forceload_block(pos)`
* forceloads the position `pos`.
* returns `true` if area could be forceloaded
* Please note that forceloaded areas are saved when the server restarts.
* `minetest.forceload_free_block(pos)`
* stops forceloading the position `pos`
Please note that forceloaded areas are saved when the server restarts.
minetest.global_exists(name)
^ Checks if a global variable has been set, without triggering a warning.
* `minetest.request_insecure_environment()`: returns an environment containing
insecure functions if the calling mod has been listed as trusted in the
`secure.trusted_mods` setting or security is disabled, otherwise returns `nil`.
* Only works at init time.
* **DO NOT ALLOW ANY OTHER MODS TO ACCESS THE RETURNED ENVIRONMENT, STORE IT IN
A LOCAL VARIABLE!**
* `minetest.global_exists(name)`
* Checks if a global variable has been set, without triggering a warning.
### Global objects
* `minetest.env`: `EnvRef` of the server environment and world.