Add minetest.player_exists() (#5064)

master
rubenwardy 2017-01-18 10:19:57 +00:00 committed by Loïc Blot
parent a378e32751
commit c5967f75f0
2 changed files with 9 additions and 5 deletions

View File

@ -114,6 +114,10 @@ function core.get_connected_players()
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)
@ -244,4 +248,3 @@ end
function core.close_formspec(player_name, formname)
return minetest.show_formspec(player_name, formname, "")
end

View File

@ -2583,6 +2583,7 @@ These functions return the leftover itemstack.
### 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"`