add support for sauth mod

master
shivajiva101 2017-10-22 18:19:14 +01:00 committed by GitHub
parent 0e097aedca
commit bf56900ae3
1 changed files with 10 additions and 7 deletions

View File

@ -5,6 +5,7 @@ with persistence of the last state across server restarts
]] ]]
local mod_data = minetest.get_mod_storage() local mod_data = minetest.get_mod_storage()
local sauth_mod = minetest.get_modpath("sauth")
local border = "OPEN" local border = "OPEN"
-- initialise -- initialise
@ -39,13 +40,15 @@ minetest.register_chatcommand("border", {
-- register hook -- register hook
minetest.register_on_prejoinplayer(function(name, ip) minetest.register_on_prejoinplayer(function(name, ip)
-- owner exception -- owner exception
if minetest.setting_get("name") == name then if minetest.setting_get("name") == name then
return return
end end
-- stop NEW players from joining -- stop NEW players from joining
if border == "CLOSED" and not core.auth_table[name] then local player = core.auth_table[name]
return ("\nSorry, no new players being admitted at this time!") if sauth_mod then player = sauth.get_auth(name, false) end -- no caching
end if border == "CLOSED" and not player then
end return ("\nSorry, no new players being admitted at this time!")
end
end
) )