Commit Graph

176 Commits

Author SHA1 Message Date
sfan5 b57dc70769 [CSM] Expose more env functions 2019-11-11 14:06:48 +01:00
sfan5 4d668f32a6 Call on_secondary_use when object is right-clicked 2019-11-10 13:12:31 +01:00
sfan5 82a2e02323 Load client mods into memory before execution.
Preperation for server-sent CSM which will eventually need this.
2019-11-09 16:08:38 +01:00
sfan5 5ab546f99b Refactor loading of Lua code with mod security 2019-11-09 16:08:38 +01:00
SmallJoker b0baa698a4 CSM: Fix itemstack:get_meta() 'metadata' indexing error 2019-09-14 19:42:30 +02:00
SmallJoker 23677be951 Load CSM environment after the restrictions are known
Safety-guards for CSM callbacks to abort on a bad implementation
Only run callbacks when the mods are loaded (and with it: builtin)

Duplication checks inside constructors
2019-09-14 19:42:25 +02:00
Jozef Behran 86d7f84b89 Merge pull request #8776 from osjc/FixGetNode
Finish getNode cleanup
2019-08-10 19:45:44 +02:00
ANAND d1c27c7e80 Allow customizing chat message format (#8529) 2019-08-08 17:04:46 +01:00
Beha b8aaef704d Move the clamping of hp/breath when their maximums change to read_object_properties(). (#8689)
This prevents set_properties() calls that have nothing to do with hp_max or breath_max overriding the saved hp before another mod has the chance to set a player's intended hp_max (such as in on_joinplayer).
2019-07-30 17:29:45 +02:00
SmallJoker 8efa1de835 Check for 'action' field in ABMs & LBMs 2019-07-27 21:13:47 +02:00
y ecd20de64d Removed debug.upvaluejoin to prevent leak of insecure environment 2019-07-24 11:43:09 +02:00
Paul Ouellette 22ad820aa4 Add node field to PlayerHPChangeReason table (#8368) 2019-04-11 20:45:39 +01:00
rubenwardy 1e3e4fb649 HPChange Reason: Fix push after free, and type being overwritten (#8359)
* HPChange Reason: Fix push after free, and type being overwritten

Fixes #8227 and #8344
2019-03-12 08:56:56 +01:00
SmallJoker ffb17f1c9a Consistent HP and damage types (#8167)
Remove deprecated HUDs and chat message handling.
Remove unused m_damage variable (compat break).
HP: s32 for setter/calculations, u16 for getter.
2019-02-10 23:03:26 +00:00
DS 07c1c72aae Fix wrong code comment (#8061)
"Get core.registered_on_chat_messages" to "Get core.registered_on_player_receive_fields" where `core.registered_on_player_receive_fields` is gotten
2019-01-06 17:21:04 +01:00
Quentin Bazin 5f1cd555cd Move client-specific files to 'src/client' (#7902)
Update Android.mk
Remove 'src/client' from include_directories
2018-11-28 20:01:49 +01:00
Dániel Juhász 325bf68041 Raycast: export exact pointing location (#6304)
* Return intersection point in node coordinates.
* Clarify 'intersection_point' documentation
2018-08-16 20:10:08 +02:00
nOOb3167 9537cfd3f8 Add a MSVC / Windows compatible snprintf function (#7353)
Use sizeof where applicable for mt_snprintf
2018-07-22 21:56:06 +02:00
Loïc Blot eef62c82a2
Modernize lua read (part 2 & 3): C++ templating assurance (#7410)
* 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-30 17:11:38 +02:00
Loïc Blot ccc3af128c
CSM/SSM: Add on_mods_loaded callback (#7411)
* CSM/SSM: Add on_mods_loaded callback
2018-06-06 12:53:59 +02:00
SmallJoker d99a033fd6
Fix builtin inventory list crash when size = 0 (#7297) 2018-05-05 22:37:07 +02:00
SmallJoker ba91624d8c
Allow damage for attached objects, add attach/detach callbacks (#6786)
* Allow right-clicking on attached LuaEntities
2018-04-30 18:43:49 +02:00
rubenwardy 87ad4d8e7f
Add online content repository
Replaces mods and texture pack tabs with a single content tab
2018-04-19 20:14:53 +01:00
SmallJoker 9fa547bb80 Run callback in IDropAction, refactor function arguments 2018-04-02 17:18:48 +02:00
SmallJoker f6eff57f7c Add player inventory callbacks 2018-04-02 17:18:48 +02:00
Loïc Blot d88c4e1822
LINT: add clang-tidy step (#6295)
* Implement new travis clang-tidy build step

* This step enable some rules and enforce one rule as error
* This permits to have some C++ quality rules based on clang & clang contributor guidelines

* Fix clang-tidy reported problems on push_back -> emplace_back
2018-04-01 23:57:55 +02:00
Loic Blot ef979ee2e9
Fix a warning reported by clang
minetest/src/script/cpp_api/s_player.h:27:1: warning: struct 'PlayerHPChangeReason' was previously declared as a class [-Wmismatched-tags]
struct PlayerHPChangeReason;
2018-03-29 13:37:24 +02:00
Andrew Ward dfc8198349
Add reasons to on_dieplayer and on_hpchange 2018-03-28 16:05:18 +01:00
red-001 338d645fcf Add `on_auth_fail` callback (#7039)
Called when a client fails to supply the correct password for the account it's attempting to login as.
2018-02-15 21:18:54 +01:00
Dániel Juhász 3face01a20 Node definition manager refactor (#7016)
* Rename IWritableNodeDefManager to NodeDefManager
* Make INodeDefManager functions const
* Use "const *NodeDefManager" instead of "*INodeDefManager"
* Remove unused INodeDefManager class
* Merge NodeDefManager and CNodeDefManager
* Document NodeDefManager
2018-02-10 21:04:16 +01:00
red-001 1e94a7feaf Move `setlocale` from Lua to C++. 2018-02-08 15:38:34 +01:00
red-001 d6050bee51 [CSM] Don't Load the package library (#6944)
Already removed by a latter step in CSM init so this just saves on pointless work.
2018-01-22 08:34:49 +01:00
Wayward One 684e70477d Change include from "cmake_config.h" to "config.h"
Fixes #6894
2018-01-21 23:25:04 +01:00
red-001 49ff1d2ea8 [CSM] Remove `on_connect` callback (#6941)
Fixes #6939
2018-01-21 18:27:27 +01:00
red-001 30821ad8de [CSM] Don't load the IO library. (#6087)
* [CSM] Don't load the IO library.

* Rename the function to match the Lua API function name and add a missing `const`

* Add a comment to explain some strange code and fix the other issues pointed out by shadowninja.
2018-01-04 08:21:12 +01:00
rubenwardy 2af47e6f5f Fix crash on can_bypass_userlimit returning non-boolean 2018-01-03 14:18:13 +00:00
Vitaliy 20a85d76d9 Move files to subdirectories (#6599)
* Move files around
2017-11-08 23:56:20 +01:00
SmallJoker f547452685 Unkown nodes: Provide position on interact (#6505)
* Unkown nodes: Provide position on interact
2017-10-07 15:11:07 +02:00
Vincent Glize 4e19791cde [CSM] Add callback on open inventory (#5793) 2017-10-02 22:09:49 +02:00
Loïc Blot 6f1c907204 Implement mod communication channels (#6351)
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-26 00:11:20 +02:00
DTA7 5a3b8e34b3 Set placer to nil instead of a non-functional one in item_OnPlace (#6449)
* 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-21 21:52:52 +02:00
SmallJoker 67f97f8d32 on_death: Fix callback number of pushed arguments (Fixes #6451) 2017-09-21 19:56:24 +02:00
sfan5 04839f233f ServerEnv: Clean up object lifecycle handling (#6414)
* ServerEnv: Clean up object lifecycle handling
2017-09-15 12:19:01 +02:00
Kahrl 17fd5fe935 Make INodeDefManager::getIds return a vector, not a set 2017-09-12 19:31:46 +02:00
Loïc Blot 40dd03e328 Implement minetest.register_can_bypass_userlimit (#6369)
* 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-04 22:08:59 +02:00
Rui c0dac4d928 Remove nodeupdate completely (#6358) 2017-09-01 13:40:09 +02:00
Loïc Blot 1c1c97cbd1 Modernize source code: last part (#6285)
* 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-20 13:30:50 +02:00
Loïc Blot fd3afbced5 Optimize headers (part 2) (#6272)
* 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-18 19:25:07 +02:00
Loïc Blot 921151d97a C++ modernize: Pragma once (#6264)
* Migrate cpp headers to pragma once
2017-08-17 22:19:39 +02:00
Loïc Blot 85511a642f Cleanup various headers to reduce compilation times (#6255)
* Cleanup various headers to reduce compilation times
2017-08-16 22:11:45 +02:00