diff options
author | Matthew I <matttpt@gmail.com> | 2012-09-08 14:44:26 -0400 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-11-30 19:26:51 +0200 |
commit | 6c8fa83ecd3f40a8e2fec890caaaa955f9d4255c (patch) | |
tree | 6bf4d32fc0f9ad1d22ac1d76f5a447bf7d6c58e4 /builtin | |
parent | ab45133ab4826359ca9a5ed50b68150eb462c8ef (diff) | |
download | minetest-6c8fa83ecd3f40a8e2fec890caaaa955f9d4255c.tar.gz minetest-6c8fa83ecd3f40a8e2fec890caaaa955f9d4255c.tar.bz2 minetest-6c8fa83ecd3f40a8e2fec890caaaa955f9d4255c.zip |
Add shutdown hook interface to Lua API
Scripts can call minetest.register_on_shutdown() to register a
shutdown hook.
Document that minetest.register_on_shutdown() callbacks may not be run
If the server crashes, it is unlikely that callbacks registered using
minetest.register_on_shutdown() will be called.
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/misc_register.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/misc_register.lua b/builtin/misc_register.lua index 77c594de2..f9c06a02a 100644 --- a/builtin/misc_register.lua +++ b/builtin/misc_register.lua @@ -303,6 +303,7 @@ end minetest.registered_on_chat_messages, minetest.register_on_chat_message = make_registration() minetest.registered_globalsteps, minetest.register_globalstep = make_registration() +minetest.registered_on_shutdown, minetest.register_on_shutdown = make_registration() minetest.registered_on_punchnodes, minetest.register_on_punchnode = make_registration() minetest.registered_on_placenodes, minetest.register_on_placenode = make_registration() minetest.registered_on_dignodes, minetest.register_on_dignode = make_registration() |