mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Allow requesting reconnect when mods kick player (#14971)
This commit is contained in:
parent
b12e67699a
commit
38b4505ad7
7 changed files with 28 additions and 37 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue