summaryrefslogtreecommitdiff
path: root/mesecons/util.lua
AgeCommit message (Collapse)Author
2022-01-01Add Luacontroller library supportcheapie
Fixes upstream #557
2021-11-27Optimize light updates when turning conductors on and off (#578)Jude Melton-Houghton
2021-08-02Handle getting out-of-bounds bits in get_bit (#574)Jude Melton-Houghton
The binary state is not padded with zeroes, so they must be inferred.
2020-12-19Replace mesecon.mergetable (#533)Vitaliy
2020-09-21Restrict Lua controller interrupt IDs (#534)Vitaliy
* Deprecate non-string IIDs * Restrict tabular IIDs to proper trees Fixes crash on recursive interrupt ID (#473)
2019-09-23Use table.copy in mesecons.tablecopyVitaliy
mesecons.tablecopy didn’t support recursive tables, while Minetest table.copy works well for them.
2017-10-08Improve rules and rule handling (#370)DS
2017-10-07Handle blasts (#356)DS
2017-01-15Luacontroller: Revert function stripping from digiline messagesJeija
2016-12-31Luacontroller: Fix bugs in 703e6fda, no more functions as keysJeija
Thanks to @ShadowNinja for reporting this Make sure functions that are keys in tables and functions inside nested tables also get removed when using digiline_send.
2016-12-28Luacontroller: Restrict digiline messagesJeija
Restrict maximum length of messages to 50.000 characters and disable sending functions or table references over the wire. Restrict types of channel variable to string, number or boolean. The missing length restriction made DoS-like attacks possible by overflowing memory using string concatenation. Thanks to gamemanj for disclosing this issue.
2016-11-17Remove an unused function.Christopher Head
2016-08-30Small cleanups in `internal.lua`, move forceloading reversal to legacyJeija
2016-08-24Implement VoxelManipulator-based transactions.Christopher Head
Rather than calling out through the Lua-to-C API for each node that needs to be read or written, a group of map reads (and optionally writes) can be grouped into a transaction. Access to map data within the transaction is provided at high speed by means of VoxelManipulators. Once the reads and writes are finished, the transaction can be committed or aborted.
2016-08-24Use VoxelManipulators for get_node_force.Christopher Head
A VoxelManipulator, when asked to read a mapblock, in addition to making that mapblock available to the caller, also pulls it into the server’s map cache, thus making get_node calls in the immediate future succeed. This has the dual advantages that not every mapblock containing a Mesecons circuit need remain loaded at all times (rather mapblocks can be loaded on demand as signals are sent), and that the server need not bother running ABMs and ticking entities within those mapblocks that are loaded due to Mesecons signalling.
2016-08-23Split wires into their own mod, introduce autoconnect hooksCarter Kolwey
The update_autoconnect function had to be abstracted away from the default wires, any kind of wire can now register autoconnect hooks, which should make having multiple different wire types much easier. mesecons_mvps, mesecons_receiver and mesecons_random made use of update_autoconnect, their code was also adapted. This also fixes a receiver bug: If a receiver was placed with a onstate receptor next to it (but not the wall lever / button that caused the receiver to appear) the receiver didn't turn on in the past. Also move documentation for mesecon wire into mesecons_wire.
2016-02-19Force-load areas with mesecon usageJeija
This is a major speedup for large mesecon machines / structures. Force-loaded areas are stored in a file to be persistent over server reboots. By default, areas are unloaded after 10 minutes (600s) without usage, this can be customized with the mesecon.forceload_timeout setting. Please turn max_forceloaded_blocks up for better performance.
2016-02-14Always use minetest.set_node instead of minetest.add_node for consistencyJeija
2016-02-14Use vector helper functions instead of old builtin cmpPos and addPosRule ↵Jeija
functions
2015-10-04Remove trailing whitespaceJeija
2015-01-03Fix #197, doesn't remove the legacy code that triggered it thoughJeija
2014-12-20Fix #196, removes soft-depend on commonlibJeija
2014-11-29Rewrite Logic Gates: Makes it super-easy to add new gates and cleans up codeJeija
Fix bugs in the Luacontroller (when placing, false input pin values were given) and fix variables leaking into the global environment in pistons.
2014-11-22Fix bug in mesecon.find_receptor that caused false turnoffs and rewrite lever +Jeija
switch
2014-11-22Use iterative algorithm for mesecon.find_receptor_on, major performance ↵Jeija
improvement for large circuits. This also fixes a crash introduced with the previous commit that occured when placing a wire crossing.
2014-11-22Fix bug in mesecon.mergetable that caused false rulesJeija
2014-11-22Replace mesecon:<some_function> with mesecon.<some_function> for greaterJeija
flexibility and because it was never inteded to be OOP in the first place. mesecon.receptor_on and mesecon.receptor_off are provided by wrappers (mesecon:receptor_on/off) for compatibility, but will be removed. Mod programmers that use mesecons: Please update! Also, fix microcontroller polluting the global namespace and remove some deprecated stuff.
2014-11-22Pressure plates and the object detector will send power to verticalJeija
wires 2 nodes below them, allows to hide circuitry powered by them. Fixes #179 Rewrite pressure plates + vertical wires using mesecon.register_node.
2014-11-22Rewrite mesecon wires. This should increase the efficiency and speed ofJeija
large machines. It also makes the wires.lua code easier to understand and more maintainable. In case any other mod depends on mesecon:update_autoconnect, please update it to use mesecon.update_autoconnect. This should also fix some other minor bugs. Please report bugs if this commit creates new ones. This commit changes wire looks and removes some unneccesary textures.
2014-01-11Add ActionQueue priority systemJeija
This makes effectors nearer to the source of the action (the receptor) update first. This defines behaviour for this piston circuit: http://i.imgur.com/9Pp2Mzb.png And defines, that this memory circuit does not work from this direction: http://i.imgur.com/jJn0aFh.png But it will work when using the switch from the other side: http://i.imgur.com/nvw0oZB.png Only if two effectors have the same distance, there is nothing we can do about it, behaviour is not defined. "Distance" is determined by the stack size of recursions in turnon / turnoff. Priorities are between 0 (lowest) and 1 (highest).
2014-01-10First draft of some kind of Action Queue (just like the globalstep queue in ↵Jeija
to_update), but more flexible and also including delay functionality (mesecon_delayer). The queue is also saved to a file, so that when restarting mesecons, delayers resume to the state they had when the game shut down. Needs testing.
2014-01-04Fix crash if metarule not foundNovatux
2014-01-04Fixes with multi-conductors that have special connectsNovatux
2013-11-30Update code to standards of Minetest 0.4.8.Uberi
2013-11-30Use minetest.swap_node() instead of mesecons' version, Minor code changesVanessa Ezekowitz
here and there to facilitate this.
2013-06-20Crossoverkhonkhortisan
2013-04-02Make pistons and movestones move objects (push only yet)Jeija
2012-12-16Cleanup and improve piston codeJeija
2012-12-08Cleanup, make and use util.lua, port command block and delayer to nodedefJeija