mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 02:00:37 +01:00
debug et amélioration de future_ban
debug d'une mauvaise variable ajout d'une vérification pour éviter de rebannir un joueur déja banni
This commit is contained in:
parent
7c7ae08bd6
commit
c35814348b
@ -26,6 +26,12 @@ minetest.register_chatcommand("future_ban", {
|
|||||||
minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
|
minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
for _,n in ipairs(future_ban_list) do
|
||||||
|
if n == param then
|
||||||
|
minetest.chat_send_player(name, param .. " is already in future ban list.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
if not minetest.get_player_by_name(param) then
|
if not minetest.get_player_by_name(param) then
|
||||||
table.insert(future_ban_list, param)
|
table.insert(future_ban_list, param)
|
||||||
minetest.chat_send_player(name, param .. " to future ban list added.")
|
minetest.chat_send_player(name, param .. " to future ban list added.")
|
||||||
@ -35,8 +41,8 @@ minetest.register_chatcommand("future_ban", {
|
|||||||
end
|
end
|
||||||
if not minetest.ban_player(param) then
|
if not minetest.ban_player(param) then
|
||||||
table.insert(future_ban_list, param)
|
table.insert(future_ban_list, param)
|
||||||
minetest.chat_send_player(name, desc .. " to future ban list added.")
|
minetest.chat_send_player(name, param .. " to future ban list added.")
|
||||||
minetest.log("action", name .. " added " .. desc .. " to future ban list.")
|
minetest.log("action", name .. " added " .. param .. " to future ban list.")
|
||||||
save_file()
|
save_file()
|
||||||
else
|
else
|
||||||
local desc = minetest.get_ban_description(param)
|
local desc = minetest.get_ban_description(param)
|
||||||
|
Loading…
Reference in New Issue
Block a user