From 35ea452ff55fc5fa2be209c55586c5b1050695fe Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Sun, 2 Jun 2024 23:37:43 -0400 Subject: [PATCH] fix bad implementation, try to redefine constant variable * fix error: passing const string as this argument discards qualifiers for server list identification id * related commit 90573105519953847be513068c1f05f1a1771d7c --- src/serverlist.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/serverlist.cpp b/src/serverlist.cpp index f23610967..9bcb2d8a3 100644 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -118,25 +118,26 @@ void sendAnnounce(AnnounceAction action, server["lag"] = lag; } - const std::string json; + const std::string json1; + const std::string json2; if (g_settings->getBool("announce_mt_url")) { if (g_settings->getBool("announce_mt_id")) { server["version"] = "0.4.16";//g_version_string; server["server_id"] = "minetest"; } - json = fastWriteJson(server); - sendAnnounceInner(action, json, base64_decode("c2VydmVycy5taW5ldGVzdC5uZXQ")); + json1 = fastWriteJson(server); + sendAnnounceInner(action, json1, base64_decode("c2VydmVycy5taW5ldGVzdC5uZXQ")); server["version"] = g_version_string; server["server_id"] = "multicraft"; - json = fastWriteJson(server); - sendAnnounceInner(action, json, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk")); + json2 = fastWriteJson(server); + sendAnnounceInner(action, json2, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk")); } else { - json = fastWriteJson(server); - sendAnnounceInner(action, json, g_settings->get("serverlist_url")); + json1 = fastWriteJson(server); + sendAnnounceInner(action, json1, g_settings->get("serverlist_url")); server["version"] = g_version_string; server["server_id"] = "multicraft"; - json = fastWriteJson(server); - sendAnnounceInner(action, json, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk")); + json2 = fastWriteJson(server); + sendAnnounceInner(action, json2, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk")); } } #endif