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 sauth_mod = minetest.get_modpath("sauth")
local border = "OPEN"
-- initialise
@ -39,13 +40,15 @@ minetest.register_chatcommand("border", {
-- register hook
minetest.register_on_prejoinplayer(function(name, ip)
-- owner exception
-- owner exception
if minetest.setting_get("name") == name then
return
return
end
-- stop NEW players from joining
if border == "CLOSED" and not core.auth_table[name] then
return ("\nSorry, no new players being admitted at this time!")
end
end
-- stop NEW players from joining
local player = core.auth_table[name]
if sauth_mod then player = sauth.get_auth(name, false) end -- no caching
if border == "CLOSED" and not player then
return ("\nSorry, no new players being admitted at this time!")
end
end
)