Closed nixnoxus closed 2 years ago
This is maybe a workaround but no solution.
The main reason for tubelib2.storage.lua
is not to serialize and store all data with each change of data.
This is one of the reasons why huge installations of machines like in TechPack or Techage are also possible on small servers.
You should fix the root cause of the server crashes and not try to bypass them .
I think that both problems should be fixed. Server crashes can never be completely excluded and if then the world data with the mod storage no longer match is very annoying.
I'm still trying to investigate the effect on performance. Maybe saving the bot position in the meta data of the box would be a more performant solution.
A server crash logically can't be predicted. Thus, to keep all data always consistent to be prepared for a crash is impossible.
However, to remove artefacts after a server crash should not be a big deal. You could try to use minetest.register_lbm
to remove artefacts.
If the signs_bot is running during a server crash, it will stand disconnected from the box afer a server restart. The box will then start a new bot, which may be affected by the disconnected one.
I can reproduce this behavior as follows:
signs_bot:box
and 2 blocks to the right of it asigns_bot:sign_cmnd
with this program:repeat 20 move 1 end exit
~$ kill -kill $(pidof minetest)
turn_left
repeat 20 backward end exit