elseif arg_type ~= "string" then
error("Invalid core.check_player_privs argument type: " .. arg_type, 2)
end
-
+
local requested_privs = {...}
local player_privs = core.get_player_privs(name)
local missing_privileges = {}
-
+
if type(requested_privs[1]) == "table" then
-- We were provided with a table like { privA = true, privB = true }.
for priv, value in pairs(requested_privs[1]) do
end
end
end
-
+
if #missing_privileges > 0 then
return false, missing_privileges
end
-
+
return true, ""
end
return temp_table
end
+function minetest.player_exists(name)
+ return minetest.get_auth_handler().get_auth(name) ~= nil
+end
+
-- Returns two position vectors representing a box of `radius` in each
-- direction centered around the player corresponding to `player_name`
function core.get_player_radius_area(player_name, radius)
function core.close_formspec(player_name, formname)
return minetest.show_formspec(player_name, formname, "")
end
-
### Misc.
* `minetest.get_connected_players()`: returns list of `ObjectRefs`
+* `minetest.player_exists(name)`: boolean, whether player exists (regardless of online status)
* `minetest.hud_replace_builtin(name, hud_definition)`
* Replaces definition of a builtin hud element
* `name`: `"breath"` or `"health"`