1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 16:15:20 +02: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
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()