summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
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 /doc/lua_api.txt
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 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt20
1 files changed, 12 insertions, 8 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index bd0cb8acb..26061eccb 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -4374,7 +4374,7 @@ Call these functions only at load time!
* Called after generating a piece of world. Modifying nodes inside the area
is a bit faster than usually.
* `minetest.register_on_newplayer(function(ObjectRef))`
- * Called after a new player has been created
+ * Called when a new player enters the world for the first time
* `minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage))`
* Called when a player is punched
* Note: This callback is invoked even if the punched player is dead.
@@ -4415,19 +4415,23 @@ Call these functions only at load time!
* Called _before_ repositioning of player occurs
* return true in func to disable regular player placement
* `minetest.register_on_prejoinplayer(function(name, ip))`
- * Called before a player joins the game
- * If it returns a string, the player is disconnected with that string as
+ * Called when a client connects to the server, prior to authentication
+ * If it returns a string, the client is disconnected with that string as
reason.
-* `minetest.register_on_joinplayer(function(ObjectRef))`
+* `minetest.register_on_joinplayer(function(ObjectRef, last_login))`
* Called when a player joins the game
+ * `last_login`: The timestamp of the previous login, or nil if player is new
* `minetest.register_on_leaveplayer(function(ObjectRef, timed_out))`
* Called when a player leaves the game
* `timed_out`: True for timeout, false for other reasons.
+* `minetest.register_on_authplayer(function(name, ip, is_success))`
+ * Called when a client attempts to log into an account.
+ * `name`: The name of the account being authenticated.
+ * `ip`: The IP address of the client
+ * `is_success`: Whether the client was successfully authenticated
+ * For newly registered accounts, `is_success` will always be true
* `minetest.register_on_auth_fail(function(name, ip))`
- * Called when a client attempts to log into an account but supplies the
- wrong password.
- * `ip`: The IP address of the client.
- * `name`: The account the client attempted to log into.
+ * Deprecated: use `minetest.register_on_authplayer(name, ip, is_success)` instead.
* `minetest.register_on_cheat(function(ObjectRef, cheat))`
* Called when a player cheats
* `cheat`: `{type=<cheat_type>}`, where `<cheat_type>` is one of: