mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Add on_grant and on_revoke callbacks (#4713)
* Add register_on_priv_grant/revoke, and on_grant/revoke to privs. Call from /grant and /revoke * Call on_grant and on_revoke callbacks from set_privs
This commit is contained in:
parent
ad9677a14f
commit
096ea031de
4 changed files with 45 additions and 3 deletions
|
@ -2446,6 +2446,12 @@ Call these functions only at load time!
|
|||
* `definition`: `{ description = "description text", give_to_singleplayer = boolean}`
|
||||
the default of `give_to_singleplayer` is true
|
||||
* To allow players with `basic_privs` to grant, see `basic_privs` minetest.conf setting.
|
||||
* `on_grant(name, granter_name)`: Called when given to player `name` by `granter_name`.
|
||||
`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 -
|
||||
once with the player name, and then with a nil player name.
|
||||
* `minetest.register_authentication_handler(handler)`
|
||||
* See `minetest.builtin_auth_handler` in `builtin.lua` for reference
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue