Check for existing player
parent
c104366f9d
commit
921d1858af
|
@ -17,6 +17,9 @@ for _, nm in pairs(bad_names) do
|
||||||
|
|
||||||
minetest.register_on_prejoinplayer(function(name, ip)
|
minetest.register_on_prejoinplayer(function(name, ip)
|
||||||
local n = string.find(string.lower(name),nm)
|
local n = string.find(string.lower(name),nm)
|
||||||
|
local wp, err = io.open(minetest.get_worldpath().."/players/"..name, "r")
|
||||||
|
if wp then return end
|
||||||
|
wp:close()
|
||||||
if n ~= nil then
|
if n ~= nil then
|
||||||
return "\nThe name .."..name.." is not allowed\n\nPlease pick a different Name."
|
return "\nThe name .."..name.." is not allowed\n\nPlease pick a different Name."
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue