1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

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
This commit is contained in:
sorcerykid 2020-05-23 06:24:06 -05:00 committed by SmallJoker
parent 037422fdba
commit 15ba75e4cf
10 changed files with 81 additions and 46 deletions

View file

@ -1068,7 +1068,7 @@ core.register_chatcommand("last-login", {
param = name
end
local pauth = core.get_auth_handler().get_auth(param)
if pauth and pauth.last_login then
if pauth and pauth.last_login and pauth.last_login ~= -1 then
-- Time in UTC, ISO 8601 format
return true, "Last login time was " ..
os.date("!%Y-%m-%dT%H:%M:%SZ", pauth.last_login)