1
0

fix bad implementation, try to use changed variable in constant function variable

* fix error: passing const string as this argument discards qualifiers
  for server list identification id
* related commit 90573105519953847be513068c1f05f1a1771d7c
This commit is contained in:
mckaygerhard 2024-06-03 00:12:59 -04:00
parent 35ea452ff5
commit 5db6593abd

View File

@ -74,12 +74,11 @@ void sendAnnounce(AnnounceAction action,
bool proto_compat = g_settings->getBool("enable_protocol_compat"); bool proto_compat = g_settings->getBool("enable_protocol_compat");
server["name"] = g_settings->get("server_name"); server["name"] = g_settings->get("server_name");
server["description"] = g_settings->get("server_description"); server["description"] = g_settings->get("server_description");
server["server_id"] = "multicraft";
if (g_settings->getBool("announce_mt_id")) { if (g_settings->getBool("announce_mt_id")) {
server["version"] = "0.4.16";//g_version_string; server["version"] = "0.4.16";
server["server_id"] = "minetest";
} else { } else {
server["version"] = g_version_string; server["version"] = g_version_string;
server["server_id"] = "multicraft";
} }
server["proto_min"] = strict_checking ? LATEST_PROTOCOL_VERSION : (proto_compat ? SERVER_PROTOCOL_VERSION_MIN : SERVER_PROTOCOL_VERSION_MIN_NOCOMPAT); server["proto_min"] = strict_checking ? LATEST_PROTOCOL_VERSION : (proto_compat ? SERVER_PROTOCOL_VERSION_MIN : SERVER_PROTOCOL_VERSION_MIN_NOCOMPAT);
server["proto_max"] = strict_checking ? LATEST_PROTOCOL_VERSION : SERVER_PROTOCOL_VERSION_MAX; server["proto_max"] = strict_checking ? LATEST_PROTOCOL_VERSION : SERVER_PROTOCOL_VERSION_MAX;
@ -118,26 +117,13 @@ void sendAnnounce(AnnounceAction action,
server["lag"] = lag; server["lag"] = lag;
} }
const std::string json1; const std::string json = fastWriteJson(server);
const std::string json2;
if (g_settings->getBool("announce_mt_url")) { if (g_settings->getBool("announce_mt_url")) {
if (g_settings->getBool("announce_mt_id")) { sendAnnounceInner(action, json, base64_decode("c2VydmVycy5taW5ldGVzdC5uZXQ"));
server["version"] = "0.4.16";//g_version_string; sendAnnounceInner(action, json, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk"));
server["server_id"] = "minetest";
}
json1 = fastWriteJson(server);
sendAnnounceInner(action, json1, base64_decode("c2VydmVycy5taW5ldGVzdC5uZXQ"));
server["version"] = g_version_string;
server["server_id"] = "multicraft";
json2 = fastWriteJson(server);
sendAnnounceInner(action, json2, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk"));
} else { } else {
json1 = fastWriteJson(server); sendAnnounceInner(action, json, g_settings->get("serverlist_url"));
sendAnnounceInner(action, json1, g_settings->get("serverlist_url")); sendAnnounceInner(action, json, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk"));
server["version"] = g_version_string;
server["server_id"] = "multicraft";
json2 = fastWriteJson(server);
sendAnnounceInner(action, json2, base64_decode("c2VydmVycy5tdWx0aWNyYWZ0Lndvcmxk"));
} }
} }
#endif #endif