From 15ba75e4cf1d1b8ceaa9d8ce33dcfdd7dbe80741 Mon Sep 17 00:00:00 2001 From: sorcerykid Date: Sat, 23 May 2020 06:24:06 -0500 Subject: 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 --- builtin/game/deprecated.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'builtin/game/deprecated.lua') 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 -- cgit v1.2.3