mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 01:25:20 +02:00
Allow requesting reconnect when mods kick player (#14971)
This commit is contained in:
@@ -365,7 +365,7 @@ int ModApiServer::l_ban_player(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
// disconnect_player(name, [reason]) -> success
|
||||
// disconnect_player(name[, reason[, reconnect]]) -> success
|
||||
int ModApiServer::l_disconnect_player(lua_State *L)
|
||||
{
|
||||
NO_MAP_LOCK_REQUIRED;
|
||||
@@ -388,7 +388,9 @@ int ModApiServer::l_disconnect_player(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
server->DenyAccess(player->getPeerId(), SERVER_ACCESSDENIED_CUSTOM_STRING, message);
|
||||
bool reconnect = readParam<bool>(L, 3, false);
|
||||
|
||||
server->DenyAccess(player->getPeerId(), SERVER_ACCESSDENIED_CUSTOM_STRING, message, reconnect);
|
||||
lua_pushboolean(L, true);
|
||||
return 1;
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ private:
|
||||
// unban_player_or_ip()
|
||||
static int l_unban_player_or_ip(lua_State *L);
|
||||
|
||||
// disconnect_player(name, [reason]) -> success
|
||||
// disconnect_player(name[, reason[, reconnect]]) -> success
|
||||
static int l_disconnect_player(lua_State *L);
|
||||
|
||||
// remove_player(name)
|
||||
|
Reference in New Issue
Block a user