diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/defaultsettings.cpp | 2 | ||||
-rw-r--r-- | src/network/networkprotocol.h | 1 | ||||
-rw-r--r-- | src/script/lua_api/l_client.cpp | 7 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp index 1ae6e0465..b061b6845 100644 --- a/src/defaultsettings.cpp +++ b/src/defaultsettings.cpp @@ -346,7 +346,7 @@ void set_default_settings(Settings *settings) settings->setDefault("max_block_send_distance", "9"); settings->setDefault("block_send_optimize_distance", "4"); settings->setDefault("server_side_occlusion_culling", "true"); - settings->setDefault("csm_restriction_flags", "30"); + settings->setDefault("csm_restriction_flags", "62"); settings->setDefault("csm_restriction_noderange", "0"); settings->setDefault("max_clearobjects_extra_loaded_blocks", "4096"); settings->setDefault("time_speed", "72"); diff --git a/src/network/networkprotocol.h b/src/network/networkprotocol.h index 0cf77b8c5..6d6708482 100644 --- a/src/network/networkprotocol.h +++ b/src/network/networkprotocol.h @@ -952,5 +952,6 @@ enum CSMRestrictionFlags : u64 { CSM_RF_READ_ITEMDEFS = 0x00000004, // Disable itemdef lookups CSM_RF_READ_NODEDEFS = 0x00000008, // Disable nodedef lookups CSM_RF_LOOKUP_NODES = 0x00000010, // Limit node lookups + CSM_RF_READ_PLAYERINFO = 0x00000020, // Disable player info lookups CSM_RF_ALL = 0xFFFFFFFF, }; diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp index 8a5867a32..6d9d832b7 100644 --- a/src/script/lua_api/l_client.cpp +++ b/src/script/lua_api/l_client.cpp @@ -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); |