mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
CSM: add requested CSM_RF_READ_PLAYERINFO (#8007)
* CSM: add requested CSM_RF_READ_PLAYERINFO This new CSM limit permit to limit PLAYERINFO read from server. It affects get_player_names call
This commit is contained in:
parent
9080d7c990
commit
a5197eaebc
7 changed files with 20 additions and 6 deletions
|
@ -116,6 +116,13 @@ int ModApiClient::l_clear_out_chat_queue(lua_State *L)
|
|||
// get_player_names()
|
||||
int ModApiClient::l_get_player_names(lua_State *L)
|
||||
{
|
||||
// clang-format off
|
||||
if (getClient(L)->checkCSMRestrictionFlag(
|
||||
CSMRestrictionFlags::CSM_RF_READ_PLAYERINFO)) {
|
||||
return 0;
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
const std::list<std::string> &plist = getClient(L)->getConnectedPlayerNames();
|
||||
lua_createtable(L, plist.size(), 0);
|
||||
int newTable = lua_gettop(L);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue