1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-27 17:28:41 +00:00

Optionally hide player names on the serverlist (#14820)

This commit adds a setting to anonymize player names when sending data to the server list.
This commit is contained in:
1F616EMO~nya 2024-08-12 02:19:53 +08:00 committed by GitHub
parent cfa9c83d33
commit f04cdc00a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 8 additions and 3 deletions

View file

@ -65,9 +65,10 @@ void sendAnnounce(AnnounceAction action,
server["game_time"] = game_time;
server["clients"] = (int) clients_names.size();
server["clients_max"] = g_settings->getU16("max_users");
server["clients_list"] = Json::Value(Json::arrayValue);
for (const std::string &clients_name : clients_names) {
server["clients_list"].append(clients_name);
if (g_settings->getBool("server_announce_send_players")) {
server["clients_list"] = Json::Value(Json::arrayValue);
for (const std::string &clients_name : clients_names)
server["clients_list"].append(clients_name);
}
if (!gameid.empty())
server["gameid"] = gameid;