Commit Graph

41 Commits

Author SHA1 Message Date
Elias Fleckenstein
5b42b5a8c2
Add mod.conf to preview clientmod () 2021-03-04 20:37:41 +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
sfan5
36d35f2fe3
CSM: Bugfixes to camera:get_pos() and camera:get_fov()
closes 
2020-05-14 21:16:45 +02:00
sfan5
1292bdbbce Various features and fixes 2020-04-11 13:12:51 +02:00
sfan5
c44318a253 [CSM] Fix and improve minetest.get_language()
Previously this method would accidentally reset the locale
and break everything.
2019-11-11 14:06:48 +01:00
sfan5
2c4cf508a9 [CSM] Implement minetest.get_csm_restrictions()
fixes 
2019-11-11 14:06:48 +01:00
sfan5
3f271564e0 Run on_item_use CSM callback even if item is not marked usable
Mods may want to to handle item interaction even if the item
is not marked usable (= server-side callback exists).
2019-11-11 14:06:48 +01:00
sfan5
b57dc70769 [CSM] Expose more env functions 2019-11-11 14:06:48 +01:00
sfan5
d961ece144 Be lenient with extra slashes for CSM paths 2019-11-09 16:08:38 +01:00
sfan5
485b669840 [CSM] Remove non-functional minetest.get_day_count() 2019-11-09 16:08:38 +01:00
sfan5
b1f2a69382 Introduce get_modpath() for CSM 2019-11-09 16:08:38 +01: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
red-001
9649e47214 [CSM] Add basic HUD manipulation. ()
* [CSM] Add basic HUD manipulation.

Workaround for on_connect not working right now.
2018-01-20 14:09:58 +01:00
Vincent Glize
4e19791cde [CSM] Add callback on open inventory () 2017-10-02 22:09:49 +02:00
Loic Blot
f7e57a0d20
preview: try to send mod channel messages 4 seconds after joining, not after loading mod 2017-09-26 08:32:07 +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
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
red-001
c91a8c7061 [CSM] Add function to get player privileges ()
* [CSM] Add function to get player privileges + move related help functions to common

* Added @Zeno- const
2017-06-07 09:09:06 +02:00
SmallJoker
673ac55a9d [CSM] Fix crash when the minimap is disabled. Caused by e25a38e 2017-05-20 10:26:09 +02:00
red-001
5ebf8f9450 [CSM] add on_item_use () 2017-05-06 21:12:44 +02:00
red-001
ae0d8f74d7 Add function to get server info. 2017-05-04 04:25:45 +01: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
bigfoot547
e80a83d1cb [CSM] Add function to set minimap shape ()
* [CSM] Add function to set minimap shape

Also deprecates `toggle_shape`.

* Oh fish, I messed that one up!

* Fix Style

* Sorry, I missed something

I still had the `luamethod` call in there!

* Add getters

* Remove extra line

* Remove useless variable

Please review again @nerzhul . Thanks!

* Satisfy nerzhul
2017-04-14 09:04:41 +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
red-001
88b9b9652a [CSM] Add function to get the server protocol version. () 2017-04-06 22:50:45 +02:00
red-001
63ac62ec8a [CSM] Add function and chat command to disconnect from server. () 2017-04-01 13:40:56 +02:00
bigfoot547
9efc5da0fb [CSM] Add function to get player names in range ()
* [CSM] Add function to get currently connected player names
2017-03-22 21:13:03 +01:00
red-001
d31750cb93 Give CSM access to use core.colorize() () 2017-03-17 19:20:13 +01:00
Loïc Blot
7b74f04a61 [CSM] Fix minimap problems ()
This fixes issue 
2017-03-17 07:54:49 +01:00
Loïc Blot
0891975ad6 [CSM] Add core.get_timeofday & core.get_day_count env calls ()
* [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-17 07:48:29 +01:00
Loïc Blot
40ce538aad [CSM] Add minimap API modifiers ()
* Rename Mapper (too generic) to Minimap
* Add lua functions to get/set position, angle, mode for minimap
* Client: rename m_mapper to m_minimap
* Add minimap to core.ui namespace (core.ui.minimap)
* Add various functions to manage minimap (show, hide, toggle_shape)
* Cleanup trivial declaration in client
2017-03-16 10:34:54 +01:00
Loïc Blot
eb88e5dd4b Add ModStorageAPI to client side modding ()
mod storage is located into user_path / client / mod_storage
2017-03-16 07:53:39 +01:00
red-001
88df9fb5b6 Add get_wielded_item 2017-03-13 23:56:05 +01:00
red-001
0727bb3ddd [CSM] Add on_punchnode callback 2017-03-13 23:56:05 +01:00
red-001
37df9cb7d7 [CSM] Add get_node and get_node_or_nil 2017-03-13 23:56:05 +01:00
red-001
073f5cf03d [CSM] Add on_dignode callback () 2017-03-13 23:56:05 +01:00
Loic Blot
ba66fce833 [CSM] storage + fixes 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