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

@ -41,7 +41,6 @@ core.builtin_auth_handler = {
return {
password = auth_entry.password,
privileges = privileges,
-- Is set to nil if unknown
last_login = auth_entry.last_login,
}
end,
@ -53,7 +52,7 @@ core.builtin_auth_handler = {
name = name,
password = password,
privileges = core.string_to_privs(core.settings:get("default_privs")),
last_login = os.time(),
last_login = -1, -- Defer login time calculation until record_login (called by on_joinplayer)
})
end,
delete_auth = function(name)