mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-24 01:30:38 +01:00
[names_per_ip] Use minetest.after
This commit is contained in:
parent
cc8c707571
commit
1d5b2aac23
@ -105,14 +105,12 @@ function ipnames.save_data()
|
||||
io.close(file)
|
||||
end
|
||||
|
||||
minetest.register_globalstep(function(t)
|
||||
ipnames.save_time = ipnames.save_time + t
|
||||
if ipnames.save_time < ipnames.save_interval then
|
||||
return
|
||||
end
|
||||
ipnames.save_time = 0
|
||||
local function tick()
|
||||
minetest.after(ipnames.save_interval, tick)
|
||||
ipnames.save_data()
|
||||
end)
|
||||
end
|
||||
|
||||
tick()
|
||||
|
||||
minetest.register_on_shutdown(function() ipnames.save_data() end)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user