Commit Graph

8 Commits

Author SHA1 Message Date
upsilon
7cf99da1a5
LuaBlock: Major changes in mod storage usage
Data associated to a LuaBlock is redundantly stored in both its metadata
and in the mod storage so that it is not possible to hack a LuaBlock by
changing its metadata or copying it using WorldEdit. This commit changes
how it is done:
* Store full code instead of storing MD5 checksum, which avoids bug
caused by serializing non-ASCII strings using minetest.serialize,
* Also store owner,
* Use `minetest.hash_node_position` instead of deprecated vector_extras
set_data_to_pos etc,
* Remove mod storage data associated with the LuaBlock when destroying
it,
* Create helper functions for manipulating the mod storage in
moremesecons_utils, I will soon update other parts of MoreMesecons as well to use them.

This commit breaks backwards compatibility: previously created LuaBlocks
will have to be reset by opening the formspec and pressing the `Submit`
button.

This commit also fixes an unrelated bug: code in the formspec was not
correctly escaped using minetest.formspec_escape.
2020-04-09 16:25:21 +02:00
Pierre-Adrien Langrognet
d580e0e974 Merge branch 'master' into settings 2017-06-04 17:57:16 +02:00
upsilon
c53ac5b660
Adjustable Blinky Plant: fix very fast blinking before having set an interval + add a minimum interval setting 2017-05-21 19:11:12 +02:00
AntumDeluge
d542d15fa4 Replace deprecated methods:
- 'setting_get' with 'settings:get'
- 'setting_getbool' with 'settings:get_bool'
2017-05-13 01:52:42 -07:00
upsilon
d8c859a162
Define vector_extras functions in moremesecons_utils
if vector_extras is not loaded
Loading vector_extras is still recommended because its functions may be more up-to-date.
2017-04-19 21:41:10 +02:00
upsilon
b60a719b14
moremesecons.setting: remove pointless val_under_min parameter 2017-04-19 18:33:36 +02:00
upsilon
ea81d826b9
moremesecons.setting: fix wrong type name
"bool" instead of "boolean"
2017-04-19 13:27:06 +02:00
upsilon
75abcb3077
Add a moremesecons_utils mod to reduce redundant code 2017-04-19 11:08:58 +02:00