add antilag mod

from appguru
This commit is contained in:
Elkien3 2020-09-06 19:12:48 -05:00
parent eaae854338
commit b86c207390

13
mods/antilag/init.lua Normal file
View File

@ -0,0 +1,13 @@
local min_lag = 1 -- in seconds
local min_times = 10 -- has to occur 10x
local times = 0
minetest.register_globalstep(function(lag)
if lag < min_lag then
times = 0
else
times = times + 1
if times >= min_times then
minetest.request_shutdown("Server shutting down due to high latency (lag).")
end
end
end)