From 52122c342d335a2561ace87c9d8deaa16a136604 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 31 Mar 2012 16:23:26 +0300 Subject: Add 'fly' and 'fast' privileges and the underlying privileges-to-client system --- doc/lua_api.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/lua_api.txt b/doc/lua_api.txt index a03d9a9e1..3ba59565b 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -506,7 +506,12 @@ minetest.register_on_respawnplayer(func(ObjectRef)) ^ currently called _before_ repositioning of player occurs minetest.register_on_chat_message(func(name, message)) minetest.register_chatcommand(cmd, chatcommand definition) -minetest.register_privilege(name, description) +minetest.register_privilege(name, definition) +^ definition: "description text" +^ definition: { + description = "description text", + give_to_singleplayer = boolean, -- default: true + } minetest.register_authentication_handler(handler) ^ See minetest.builtin_auth_handler in builtin.lua for reference @@ -516,13 +521,20 @@ minetest.setting_getbool(name) -> boolean value or nil minetest.add_to_creative_inventory(itemstring) Authentication: +minetest.notify_authentication_modified(name) +^ Should be called by the authentication handler if privileges change. +^ To report everybody, set name=nil. minetest.get_password_hash(name, raw_password) -minetest.set_player_password(name, password_hash) +^ Convert a name-password pair to a password hash that minetest can use minetest.string_to_privs(str) -> {priv1=true,...} minetest.privs_to_string(privs) -> "priv1,priv2,..." +^ Convert between two privilege representations +minetest.set_player_password(name, password_hash) minetest.set_player_privs(name, {priv1=true,...}) minetest.get_player_privs(name) -> {priv1=true,...} +^ These call the authentication handler minetest.check_player_privs(name, {priv1=true,...}) -> bool, missing_privs +^ A quickhand for checking privileges Chat: minetest.chat_send_all(text) -- cgit v1.2.3