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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user