forked from mtcontrib/name_restrictions
Allow exemptions to simple matching and case-insensitivity checks
This commit is contained in:
parent
7004761af6
commit
75b96c7cf9
7
init.lua
7
init.lua
@ -17,6 +17,7 @@ temp = nil
|
||||
exemptions[minetest.setting_get("name")] = true
|
||||
exemptions["singleplayer"] = true
|
||||
|
||||
|
||||
---------------------
|
||||
-- Simple matching --
|
||||
---------------------
|
||||
@ -34,6 +35,9 @@ local disallowed = {
|
||||
}
|
||||
|
||||
minetest.register_on_prejoinplayer(function(name, ip)
|
||||
if exemptions[name] then return end
|
||||
|
||||
-- Check for disallowed names
|
||||
local lname = name:lower()
|
||||
for re, reason in pairs(disallowed) do
|
||||
if lname:find(re) then
|
||||
@ -48,6 +52,9 @@ end)
|
||||
------------------------
|
||||
|
||||
minetest.register_on_prejoinplayer(function(name, ip)
|
||||
if exemptions[name] then return end
|
||||
|
||||
-- Check for used names
|
||||
local lname = name:lower()
|
||||
for iname, data in pairs(minetest.auth_table) do
|
||||
if iname:lower() == lname and iname ~= name then
|
||||
|
Loading…
Reference in New Issue
Block a user