summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2017-08-29 06:57:56 +0100
committerLoïc Blot <nerzhul@users.noreply.github.com>2017-08-29 07:57:56 +0200
commit72c09f524b1616dd75bb6e35008196b5ca6351a2 (patch)
tree1f79a46acdd79d1a1885556f0ca86fd04649e09b /doc/lua_api.txt
parent2bd1a312394a49d1005026e5ec3f930eb659d2f0 (diff)
downloadminetest-72c09f524b1616dd75bb6e35008196b5ca6351a2.tar.gz
minetest-72c09f524b1616dd75bb6e35008196b5ca6351a2.tar.bz2
minetest-72c09f524b1616dd75bb6e35008196b5ca6351a2.zip
Fix mistake when calling on_priv_grant/revoke, and document them (#6341)
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt11
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index b62fac67d..9d490afde 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -2447,6 +2447,14 @@ Call these functions only at load time!
* `minetest.register_on_item_eat(func(hp_change, replace_with_item, itemstack, user, pointed_thing))`
* Called when an item is eaten, by `minetest.item_eat`
* Return `true` or `itemstack` to cancel the default item eat response (i.e.: hp increase)
+* `minetest.register_on_priv_grant(function(name, granter, priv))`
+ * Called when `granter` grants the priv `priv` to `name`.
+ * Note that the callback will be called twice if it's done by a player, once with granter being the player name,
+ and again with granter being nil.
+* `minetest.register_on_priv_revoke(function(name, revoker, priv))`
+ * Called when `revoker` revokes the priv `priv` from `name`.
+ * Note that the callback will be called twice if it's done by a player, once with revoker being the player name,
+ and again with revoker being nil.
### Other registration functions
* `minetest.register_chatcommand(cmd, chatcommand definition)`
@@ -2464,8 +2472,9 @@ Call these functions only at load time!
`granter_name` will be nil if the priv was granted by a mod.
* `on_revoke(name, revoker_name)`: Called when taken from player `name` by `revoker_name`.
`revoker_name` will be nil if the priv was revoked by a mod
- * Note that the above two callbacks will be called twice if a player is responsible -
+ * Note that the above two callbacks will be called twice if a player is responsible -
once with the player name, and then with a nil player name.
+ * Return true in the above callbacks to stop register_on_priv_grant or revoke being called.
* `minetest.register_authentication_handler(handler)`
* See `minetest.builtin_auth_handler` in `builtin.lua` for reference