aboutsummaryrefslogtreecommitdiff
path: root/builtin/game/deprecated.lua
diff options
context:
space:
mode:
authorsorcerykid <rkrause@inbox.com>2020-05-23 06:24:06 -0500
committerSmallJoker <mk939@ymail.com>2020-05-23 13:25:29 +0200
commit15ba75e4cf1d1b8ceaa9d8ce33dcfdd7dbe80741 (patch)
tree482763407643cd776af9bd2c79e241969bbc644f /builtin/game/deprecated.lua
parent037422fdba9a47bd538480988fbf8aad67d66c85 (diff)
downloadminetest-15ba75e4cf1d1b8ceaa9d8ce33dcfdd7dbe80741.tar.gz
minetest-15ba75e4cf1d1b8ceaa9d8ce33dcfdd7dbe80741.tar.bz2
minetest-15ba75e4cf1d1b8ceaa9d8ce33dcfdd7dbe80741.zip
Add on_authplayer callback and 'last_login' to on_joinplayer (#9574)
Replace on_auth_fail callback with more versatile on_authplayer Better clarify account login process in Lua API documentation Change initial timestamp for newly registered accounts to -1
Diffstat (limited to 'builtin/game/deprecated.lua')
-rw-r--r--builtin/game/deprecated.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/builtin/game/deprecated.lua b/builtin/game/deprecated.lua
index 73e105eb8..20f0482eb 100644
--- a/builtin/game/deprecated.lua
+++ b/builtin/game/deprecated.lua
@@ -70,3 +70,19 @@ core.setting_get = setting_proxy("get")
core.setting_setbool = setting_proxy("set_bool")
core.setting_getbool = setting_proxy("get_bool")
core.setting_save = setting_proxy("write")
+
+--
+-- core.register_on_auth_fail
+--
+
+function core.register_on_auth_fail(func)
+ core.log("deprecated", "core.register_on_auth_fail " ..
+ "is obsolete and should be replaced by " ..
+ "core.register_on_authplayer instead.")
+
+ core.register_on_authplayer(function (player_name, ip, is_success)
+ if not is_success then
+ func(player_name, ip)
+ end
+ end)
+end