Commit Graph

34 Commits

Author SHA1 Message Date
Wuzzy
6cdb150c8b
Remove hardcoded "You died." message in chat () 2021-07-12 20:32:27 +02:00
DS
8f085e02a1
Add metatables to lua vectors ()
Add backwards-compatible metatable functions for vectors.
2021-06-04 21:22:33 +02:00
Wuzzy
cafad6ac03 Translate builtin ()
This PR is the second attempt to translate builtin.
Server-sent translation files can be added to `builtin/locale/`, whereas client-side translations depend on gettext.
2021-03-05 16:29:48 +01:00
DS
9d370b78da
Add documentation to builtin core.run_callbacks () 2020-10-21 21:05:32 +01:00
Elijah Duffy
7d3641021b
Lua API: Add register_on_chatcommand to SSM and CSM ()
Allows catching a chatcommand call just after the command and the
parameters are parsed but before its existence is checked and before the
corresponding function is run. Returning `true` from a callback function
will prevent default handling of the command leaving mods to handle the
command manually.
2020-10-03 17:38:08 +01:00
rubenwardy
8e757859d6
Add luacheck to check builtin () 2019-08-06 19:30:18 +01:00
Loïc Blot
a5197eaebc
CSM: add requested CSM_RF_READ_PLAYERINFO ()
* CSM: add requested CSM_RF_READ_PLAYERINFO

This new CSM limit permit to limit PLAYERINFO read from server.

It affects get_player_names call
2018-12-24 10:51:10 +01:00
Paramat
2e37ee9565
CSM: Don't create the client script environment if CSM is disabled ()
Use the CSM death formspec when CSM is enabled and use the engine death formspec when CSM is disabled.
Move the CSM death formspec code to a dedicated file.
2018-11-24 10:41:11 +00:00
Loïc Blot
ccc3af128c
CSM/SSM: Add on_mods_loaded callback ()
* CSM/SSM: Add on_mods_loaded callback
2018-06-06 12:53:59 +02:00
red-001
49ff1d2ea8 [CSM] Remove on_connect callback ()
Fixes 
2018-01-21 18:27:27 +01:00
Vincent Glize
4e19791cde [CSM] Add callback on open inventory () 2017-10-02 22:09:49 +02:00
Loïc Blot
6f1c907204 Implement mod communication channels ()
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
Loic Blot
84aa845911
Revert "CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand""
This reverts commit bdac12761cd92960c3df83c932aa610f2322215f.
2017-07-15 09:28:10 +02:00
rubenwardy
bdac12761c CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand"
Original PR: .
This reverts commit 39f4a2f607d44738d60db84eba4b30e3d7450204.
2017-07-15 01:35:18 +01:00
red-001
f3ad75691a Create a filesystem abstraction layer for CSM and only allow accessing files that are scanned into it. ()
* 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-30 20:14:39 +02:00
DS
44495ea719 CSM: Fix documentation error for register_on_*_chat_messages () 2017-06-09 15:48:04 +02:00
Pierre-Adrien Langrognet
39f4a2f607 [CSM] Add send_chat_message and run_server_chatcommand API functions ()
* [CSM] Add send_chat_message and run_server_chatcommand API functions

* Add client-side chat message rate limiting

* Limit out chat queue size

* [CSM] Add minetest.clear_out_chat_queue API function and .clear_chat_queue chatcommand

* Last fixes/cleanups before merge
2017-05-21 23:06:51 +02:00
red-001
5ebf8f9450 [CSM] add on_item_use () 2017-05-06 21:12:44 +02:00
Vincent Glize
dc5bc6cac7 [CSM] Add event on_place_node API lua ()
* [CSM] Add event on_place_node API lua
2017-04-29 12:08:16 +02:00
red-001
4e2479e46a [CSM] Allow escaping chatcommands and add missing calls to gettext. () 2017-04-11 23:35:25 +02:00
red-001
eb587996e4 [CSM] Use more gettext () 2017-04-10 21:14:00 +02:00
red-001
e8d8723320 [CSM] Move .list_players and .disconnect to builtin. () 2017-04-10 21:13:20 +02:00
Vincent Glize
f73534640a [CSM] Add event on_connect player API lua ()
* Add event on_connect player API lua
2017-04-08 08:20:30 +02:00
Loic Blot
6da828c471
Expose vector helpers to CSM 2017-04-06 07:57:49 +02:00
red-001
e70e15134c Change command prefix to "." and add "help" command. 2017-03-26 05:51:14 +01:00
red-001
0727bb3ddd [CSM] Add on_punchnode callback 2017-03-13 23:56:05 +01:00
red-001
073f5cf03d [CSM] Add on_dignode callback () 2017-03-13 23:56:05 +01:00
red-001
a50d07d39a [CSM] Improve security for client-sided mods () 2017-03-13 23:56:05 +01:00
Loïc Blot
92b45b2a18 [CSM] implement client side mod loading ()
* client side mods are located in clientmods/
* move builtin/preview.lua to clientmods/preview/init.lua as a preview mod
* refactor ModConfiguration class to work properly with client and server using child objects
* move some Server constructor mod load code to ModConfiguration to reduce code duplication between client and server
* remove mods.{cpp,h} unused functions
* use UNORDERED_SET instead of std::set in some modspec storages
2017-03-13 23:56:05 +01:00
red-001
c42c53fccf [CSM] Add local formspecs. () 2017-03-13 23:56:05 +01:00
Loïc Blot
2c19d51409 [CSM] sound_play & sound_stop support + client_lua_api doc ()
* 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 23:56:05 +01:00
red-001
d7bc346981 [CSM] Add client-sided chat commands () 2017-03-13 23:56:05 +01:00
Loïc Blot
9978f5af82 [CSM] Add on_death, on_hp_modification & oh_damage_taken callbacks ()
* Add on_death callback
* Add on_hp_modification & on_damage_taken callbacks
* move preview code to preview.lua
2017-03-13 23:56:05 +01:00
Loic Blot
2efae3ffd7 [CSM] Client side modding
* 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-03-13 23:56:05 +01:00