From ad25fb61f76b88e27caa9d9bd9759c990c400a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Sat, 10 Oct 2020 23:35:44 +0200 Subject: Squashed 'auth_export/' content from commit 77f7a30 git-subtree-dir: auth_export git-subtree-split: 77f7a301678e6e4b121d0f4729594f5cb34d8c39 --- init.lua | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 init.lua (limited to 'init.lua') diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..cbf5378 --- /dev/null +++ b/init.lua @@ -0,0 +1,26 @@ +local http = minetest.request_http_api() +mail = {} +local MP = minetest.get_modpath(minetest.get_current_modname()) +mail.webmail = {} +mail.webmail.disallow_banned_players = true +if http then + local webmail_url = "http://127.0.0.1:8080" + local webmail_key = "foo bar baz" -- not used in the mod but might get used in the future. + + if not webmail_url then error("webmail.url is not defined") end + if not webmail_key then error("webmail.key is not defined") end + + print("[mail] loading webmail-component with endpoint: " .. webmail_url) + dofile(MP .. "/webmail.lua") + mail.webmail_init(http, webmail_url, webmail_key) +end + + +minetest.register_on_prejoinplayer(function(name, ip) + if minetest.player_exists(name) then + return + end + if name:match("_") then + return "For security reasons, underscores are banned on this server. Please choose another username!" + end +end) -- cgit v1.2.3