aboutsummaryrefslogtreecommitdiff
path: root/src/script/cpp_api
AgeCommit message (Collapse)Author
2017-10-02[CSM] Add callback on open inventory (#5793)Vincent Glize
2017-09-26Implement mod communication channels (#6351)Loïc Blot
Implement network communication for channels * Implement ModChannel manager server side to route incoming messages from clients to other clients * Add signal handler switch on client & ModChannelMgr on client to handle channels * Add Lua API bindings + client packet sending + unittests * Implement server message sending * Add callback from received message handler to Lua API using registration method
2017-09-21Set placer to nil instead of a non-functional one in item_OnPlace (#6449)DTA7
* Set placer to nil instead of a non-functional one This requires nil checks in core.rotate_node and core.rotate_and_place.
2017-09-21on_death: Fix callback number of pushed arguments (Fixes #6451)SmallJoker
2017-09-15ServerEnv: Clean up object lifecycle handling (#6414)sfan5
* ServerEnv: Clean up object lifecycle handling
2017-09-12Make INodeDefManager::getIds return a vector, not a setKahrl
2017-09-04Implement minetest.register_can_bypass_userlimit (#6369)Loïc Blot
* Implement minetest.register_on_userlimit_check This new callback permits to bypass the max_users parameter with new mods condition, based on player name or IP Only one mod needs to permit it. Move core part for builtin privileges checks to builtin
2017-09-01Remove nodeupdate completely (#6358)Rui
2017-08-20Modernize source code: last part (#6285)Loïc Blot
* Modernize source code: last par * Use empty when needed * Use emplace_back instead of push_back when needed * For range-based loops * Initializers fixes * constructors, destructors default * c++ C stl includes
2017-08-18Optimize headers (part 2) (#6272)Loïc Blot
* Optimize headers (part 2) * less debug.h in headers * less remoteplayer.h for everybody * Cleanup (part 2) * camera.h: mesh.h * mapgen.h: mapnode.h * serverenvironment.h: mapblock.h * nodedef.h: shader.h
2017-08-17C++ modernize: Pragma once (#6264)Loïc Blot
* Migrate cpp headers to pragma once
2017-08-16Cleanup various headers to reduce compilation times (#6255)Loïc Blot
* Cleanup various headers to reduce compilation times
2017-07-27Add LuaEntity on_death callback (#6177)Loïc Blot
Add LuaEntity on_death callback This fixes #5474
2017-07-11Add 'plantlike_rooted' drawtypenumber Zero
Useful for underwater plants. Node consists of a base cube plus a plantlike extension that can pass through liquid nodes above without creating air bubbles or interfering with liquid flow. Uses paramtype2 'leveled', param2 defines height of plantlike extension.
2017-07-07Expose getPointedThing to LuaDániel Juhász
This commit introduces Raycast, a Lua user object, which can be used to perform a raycast on the map. The ray is continuable, so one can also get hidden nodes (for example to see trough glass).
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-19C++11 cleanup on constructors (#6000)Vincent Glize
* C++11 cleanup on constructors dir script
2017-06-11Remove threads.h and replace its definitions with their C++11 equivalents ↵ShadowNinja
(#5957) This also changes threadProc's signature, since C++11 supports arbitrary thread function signatures.
2017-06-10C++11 patchset 6: forbid object copy using assigment/copy function deleters ↵Loïc Blot
(#5945) C++11 implement function deleting, it's generally used to prevent some object copy In script API use this function removal on ScriptApiBase instead of ScriptApiClient/Server/MainMenu, this affect all ScriptApis Move DISABLE_CLASS_COPY with constructor, the deleted function permit to replace function in its original place
2017-06-10Order es_DrawType exactly like enum NodeDrawType in nodedef.h (#5946)Thomas--S
This will help to avoid some strange bugs.
2017-06-09CSM: Fix documentation error for register_on_*_chat_messages (#5917)DS
2017-06-06Use C++11 mutexes only (remove compat code) (#5922)Loïc Blot
* Fix event LINT & remove default constructor/destructors * remove compat code & modernize autolock header
2017-05-20Fix CSM crash (#5779)red-001
Caused by dc5bc6c and them made worse by 5ebf8f9
2017-05-18Fix a warning pointed by GCC 7.1Loic Blot
lua_tonumber overflow in snprintf (12 bytes and only 10 can be written)
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-05-06[CSM] add `on_item_use` (#5544)red-001
2017-04-29[CSM] Add event on_place_node API lua (#5548)Vincent Glize
* [CSM] Add event on_place_node API lua
2017-04-25Fix various points reported by cppcheck (#5656)Loïc Blot
* Fix various performance issues reported by cppcheck + code style (CI) * Make CI happy with code style on master * guiFileSelectMenu: remove useless includes * some performance fixes pointed by cppcheck * remove some useless casts * TextDest: remove unused setFormSpec function * Fix various iterator post-increment reported by cppcheck
2017-04-23Pass clang-format on various cpp/header files (#5559)Loïc Blot
2017-04-22Add on_flood() callback.Auke Kok
This callback is called if a liquid definitely floods a non-air node on the map. The callback arguments are (pos, oldnode, newnode) and can return a `bool` value indicating whether flooding the node should be cancelled (`return true` will prevent the node from flooding). Documentation is added, the callback function was tested with a modified minetest_game. Note that `return true` will likely cause the node's `on_flood()` callback to be called every second until the node gets removed, so care must be taken to prevent many callbacks from using this return value. The current default liquid update interval is 1.0 seconds, which isn't unmanageable. The larger aim of this patch is to remove the lava cooling ABM, which is a significant cost to idle servers that have lava on their map. This callback will be much more efficient.
2017-04-20Fix various copy instead of const ref reported by cppcheck (part 3) (#5616)Loïc Blot
* Also remove 2 non declared but defined functions * Make some functions around const ref changes const
2017-04-17Plug two minor Leaks (#5603)Auke Kok
* Resource leak: CHECK_FILE_ERR returns, without freeing chunk_name. Found with static analysis. * Resource leak: leaks `page` on error path. Found with static analysis.
2017-04-08Hardware coloring for itemstacksDániel Juhász
Adds the possibility to colorize item stacks based on their metadata. In the item/node definition you can specify palette (an image file) and color (fallback color if the item has no palette or metadata). Then you can add palette_index to the metadata. Dropped itemstacks with different colors do not merge.
2017-04-08code style fix on src/script/cpp_api/s_client.hLoic Blot
2017-04-08[CSM] Add event on_connect player API lua (#5540)Vincent Glize
* Add event on_connect player API lua
2017-04-07Pass clang-format on 14 trivial header files fixesLoic Blot
Also remove them from whitelist
2017-03-30Paramtype2: Add missing type CPT2_GLASSLIKE_LIQUID_LEVELparamat
Add the missing paramtype2 for param2 controlling the liquid level inside the glasslike_framed drawtype. Add missing documentation of the feature to lua_api.txt. Update and improve comments for drawtype enumerations in nodedef.h.
2017-03-19Block access to the `io` libraryred-001
2017-03-17[CSM] Add core.get_timeofday & core.get_day_count env calls (#5401)Loïc Blot
* [CSM] Add core.get_timeofday & core.get_day_count env calls * [CSM] Add core.get_node_level, core.get_node_max_level, core.find_node_near
2017-03-13Add `get_wielded_item`red-001
2017-03-13[CSM] Add enable_client_modding param (default: false)nerzhul
2017-03-13[CSM] Add `on_punchnode` callbackred-001
2017-03-13[CSM] Add `on_dignode` callback (#5140)red-001
2017-03-13[CSM] Improve security for client-sided mods (#5100)red-001
2017-03-13[CSM] Add local formspecs. (#5094)red-001
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 on_death, on_hp_modification & oh_damage_taken callbacks (#5093)Loïc Blot
* Add on_death callback * Add on_hp_modification & on_damage_taken callbacks * move preview code to preview.lua
2017-03-13[CSM] Client side moddingLoic Blot
* rename GameScripting to ServerScripting * Make getBuiltinLuaPath static serverside * Add on_shutdown callback * Add on_receiving_chat_message & on_sending_chat_message callbacks * ScriptApiBase: use IGameDef instead of Server This permits to share common attribute between client & server * Enable mod security in client side modding without conditions
2017-02-01Tell on_punch to expect a return valueDuane Robertson
The return value should be interpreted as a boolean saying whether the lua on_punch function handled damage or the system needs to.
2017-01-28Make entity on_punch have same signature and behaviour as player on_punchsapier