1
0
Fork 0
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:
1F616EMO~nya 2024-09-13 05:42:46 +08:00 committed by GitHub
parent b12e67699a
commit 38b4505ad7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 28 additions and 37 deletions

View file

@ -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;
}