1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-06-28 06:11:47 +02:00

Added forbidden names list

This commit is contained in:
Gael-de-Sailly
2015-03-02 21:46:38 +01:00
parent 911f49faa4
commit 989b94df71
2 changed files with 61 additions and 0 deletions

View File

@ -17,6 +17,16 @@ temp = nil
exemptions[minetest.setting_get("name")] = true
exemptions["singleplayer"] = true
local disallowed_names = {}
local file = io.open(minetest.get_worldpath("name_restrictions") .. "/forbidden_names.txt", "r")
if file then
for line in file:lines() do
local low_line = line:lower()
disallowed_names[low_line] = true
end
file:close()
end
---------------------
-- Simple matching --
---------------------
@ -41,6 +51,9 @@ minetest.register_on_prejoinplayer(function(name, ip)
return reason
end
end
if disallowed_names[lname] then
return "Sorry. This name is forbidden."
end
end)