Ajoute message de chargement du mod dans le journal "action"
- Réindentation du code
This commit is contained in:
parent
824c25ce35
commit
86e0699d52
8
init.lua
8
init.lua
@ -21,8 +21,7 @@ local function check_moved()
|
||||
if d < MINDIST then
|
||||
time_afk[plname] = (time_afk[plname] or 0) + INTERVAL
|
||||
if time_afk[plname] >= TIMEOUT then
|
||||
minetest.kick_player(plname,
|
||||
"Inactive for "..TIMEOUT.." seconds.")
|
||||
minetest.kick_player(plname, "Inactive for "..TIMEOUT.." seconds.")
|
||||
kicked = true
|
||||
end
|
||||
else
|
||||
@ -37,8 +36,11 @@ local function check_moved()
|
||||
end
|
||||
minetest.after(INTERVAL, check_moved)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
minetest.register_on_leaveplayer(
|
||||
function(player)
|
||||
local plname = player:get_player_name()
|
||||
time_afk[plname] = nil
|
||||
last_pos[plname] = nil
|
||||
end)
|
||||
|
||||
minetest.log("action", "[player_inactive] loaded.")
|
||||
|
Loading…
Reference in New Issue
Block a user