aboutsummaryrefslogtreecommitdiff
path: root/src/serverlist.cpp
diff options
context:
space:
mode:
authorGabriel PĂ©rez-Cerezo <gabriel@gpcf.eu>2021-03-21 22:06:04 +0100
committergpcf <gpcf@gpcf.eu>2024-07-03 17:10:22 +0200
commit31317962220f36312cc4e36b07cc3699f8b9854b (patch)
treead4c4a309b94d452fc46a326c2d3ca77ba94b53b /src/serverlist.cpp
parent587f6656a4b86346e35da1b43b48b832d3f1b32e (diff)
downloadminetest-31317962220f36312cc4e36b07cc3699f8b9854b.tar.gz
minetest-31317962220f36312cc4e36b07cc3699f8b9854b.tar.bz2
minetest-31317962220f36312cc4e36b07cc3699f8b9854b.zip
anonymize player list
Diffstat (limited to 'src/serverlist.cpp')
-rw-r--r--src/serverlist.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/serverlist.cpp b/src/serverlist.cpp
index 29e3ac9a6..7413e1621 100644
--- a/src/serverlist.cpp
+++ b/src/serverlist.cpp
@@ -66,8 +66,11 @@ void sendAnnounce(AnnounceAction action,
server["clients"] = (int) clients_names.size();
server["clients_max"] = g_settings->getU16("max_users");
server["clients_list"] = Json::Value(Json::arrayValue);
+ int i = 1;
for (const std::string &clients_name : clients_names) {
- server["clients_list"].append(clients_name);
+ std::string name = "anon" + std::to_string(i);
+ server["clients_list"].append(name);
+ i++;
}
if (!gameid.empty())
server["gameid"] = gameid;