Commit Graph

24 Commits

Author SHA1 Message Date
sorcerykid 15ba75e4cf Add on_authplayer callback and 'last_login' to on_joinplayer (#9574)
Replace on_auth_fail callback with more versatile on_authplayer
    Better clarify account login process in Lua API documentation
    Change initial timestamp for newly registered accounts to -1
2020-05-23 13:25:29 +02: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
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
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
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
rubenwardy 2af47e6f5f Fix crash on can_bypass_userlimit returning non-boolean 2018-01-03 14:18:13 +00: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
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
Diego Martinez dac40af6ee Server: Add reason for leave to `on_leaveplayer` callbacks 2016-06-11 04:17:04 +01:00
Kahrl 3304e1e517 Push error handler afresh each time lua_pcall is used
Fixes "double fault" / "error in error handling" messages
(issue #1423) and instead shows a complete backtrace.
2015-08-27 01:56:06 +02:00
kwolekr 2b04ab874d SAPI: Track last executed mod and include in error messages 2015-08-12 23:56:12 -04:00
kwolekr bcf47bc67c Improve Script CPP API diagnostics 2015-08-05 21:13:03 -04:00
TeTpaAka aa13baa30a Add minetest.register_on_player_hpchange 2015-06-13 19:40:31 +02:00
kwolekr da34a2b33e Replace instances of std::map<std::string, std::string> with StringMap
Also, clean up surrounding code style
Replace by-value parameter passing with const refs when possible
Fix post-increment of iterators
2015-05-19 16:10:49 -04:00
Brandon c5b4e54174 Add minetest.register_on_punchplayer 2015-05-15 11:09:55 +02:00
ShadowNinja 741df993ff Fix object reference pushing functions when called from coroutines 2014-10-07 16:37:45 -04:00
ShadowNinja c4359ff65c Use "core" namespace internally 2014-05-08 13:02:04 -04:00
kaeza 33de69a173 Add 'on_prejoinplayer' callback 2013-12-12 13:42:14 -05:00
Kahrl 4e1f50035e Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenu 2013-08-14 21:03:33 +02:00
Perttu Ahola 8831669505 Allow mods to listen to cheat detections using minetest.register_on_cheat() 2013-08-04 00:45:49 +03:00
sapier ab43377577 Move scriptapi to separate folder (by sapier)
On the lua side, notably minetest.env:<function>(<args>) should now
be replaced by minetest.<function>(<args>).
The old way is and will stay supported for a long time.

Also:
Update and clean up lua_api.txt (by celeron55)
Move EnvRef to lua and remove add_rat and add_firefly (by kahrl)
Add separate src/util/CMakeLists.txt, other minor fixes (by kahrl)
2013-05-25 00:51:02 +02:00