fixed typo on parameter and adjusted logic for interval

This commit is contained in:
- 2022-01-25 22:04:59 -08:00
parent 7a33519d77
commit cfa2f41f1b
1 changed files with 5 additions and 6 deletions

View File

@ -146,14 +146,13 @@ function mlogout ()
minetest.log("action", "matrix_bridge - signing out.") minetest.log("action", "matrix_bridge - signing out.")
end end
local GLOBAL_STEPS = 0 local SECONDS = 0
minetest.register_globalstep(function(dtine) minetest.register_globalstep(function(dtime)
-- print(GLOBAL_STEPS) SECONDS = SECONDS + dtime
local GLOBAL_THRESHHOLD = 50 if SECONDS > 5 then
if GLOBAL_STEPS == GLOBAL_THRESHHOLD then
msync(since) msync(since)
SECONDS = 0 -- reset
end end
GLOBAL_STEPS = (GLOBAL_STEPS + 1) % (GLOBAL_THRESHHOLD+1)
end) end)
minetest.register_chatcommand("matrix", { minetest.register_chatcommand("matrix", {