1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Implemented disconnect_player (#10492)

Co-authored-by: rubenwardy <rw@rubenwardy.com>
This commit is contained in:
Corey Powell 2021-11-26 14:19:40 -05:00 committed by GitHub
parent c85aa0030f
commit 413be76c63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 22 additions and 8 deletions

View file

@ -6,6 +6,16 @@ local S = core.get_translator("__builtin")
-- Misc. API functions
--
-- @spec core.kick_player(String, String) :: Boolean
function core.kick_player(player_name, reason)
if type(reason) == "string" then
reason = "Kicked: " .. reason
else
reason = "Kicked."
end
return core.disconnect_player(player_name, reason)
end
function core.check_player_privs(name, ...)
if core.is_player(name) then
name = name:get_player_name()