mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 08:03:45 +01: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:
parent
cfa9c83d33
commit
f04cdc00a6
@ -825,6 +825,9 @@ server_url (Server URL) string https://minetest.net
|
|||||||
# Automatically report to the serverlist.
|
# Automatically report to the serverlist.
|
||||||
server_announce (Announce server) bool false
|
server_announce (Announce server) bool false
|
||||||
|
|
||||||
|
# Send names of online players to the serverlist. If disabled only the player count is revealed.
|
||||||
|
server_announce_send_players (Send player names to the server list) bool true
|
||||||
|
|
||||||
# Announce to this serverlist.
|
# Announce to this serverlist.
|
||||||
serverlist_url (Serverlist URL) string servers.minetest.net
|
serverlist_url (Serverlist URL) string servers.minetest.net
|
||||||
|
|
||||||
|
@ -535,6 +535,7 @@ void set_default_settings()
|
|||||||
settings->setDefault("server_address", "");
|
settings->setDefault("server_address", "");
|
||||||
settings->setDefault("server_name", "");
|
settings->setDefault("server_name", "");
|
||||||
settings->setDefault("server_description", "");
|
settings->setDefault("server_description", "");
|
||||||
|
settings->setDefault("server_announce_send_players", "true");
|
||||||
|
|
||||||
settings->setDefault("enable_console", "false");
|
settings->setDefault("enable_console", "false");
|
||||||
settings->setDefault("display_density_factor", "1");
|
settings->setDefault("display_density_factor", "1");
|
||||||
|
@ -65,8 +65,9 @@ void sendAnnounce(AnnounceAction action,
|
|||||||
server["game_time"] = game_time;
|
server["game_time"] = game_time;
|
||||||
server["clients"] = (int) clients_names.size();
|
server["clients"] = (int) clients_names.size();
|
||||||
server["clients_max"] = g_settings->getU16("max_users");
|
server["clients_max"] = g_settings->getU16("max_users");
|
||||||
|
if (g_settings->getBool("server_announce_send_players")) {
|
||||||
server["clients_list"] = Json::Value(Json::arrayValue);
|
server["clients_list"] = Json::Value(Json::arrayValue);
|
||||||
for (const std::string &clients_name : clients_names) {
|
for (const std::string &clients_name : clients_names)
|
||||||
server["clients_list"].append(clients_name);
|
server["clients_list"].append(clients_name);
|
||||||
}
|
}
|
||||||
if (!gameid.empty())
|
if (!gameid.empty())
|
||||||
|
Loading…
Reference in New Issue
Block a user