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:
@ -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)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user