aboutsummaryrefslogtreecommitdiff
path: root/src/serverlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/serverlist.cpp')
-rw-r--r--src/serverlist.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/serverlist.cpp b/src/serverlist.cpp
index a33d1d6bf..de7962a68 100644
--- a/src/serverlist.cpp
+++ b/src/serverlist.cpp
@@ -69,8 +69,12 @@ std::vector<ServerListSpec> getLocal()
std::vector<ServerListSpec> getOnline()
{
std::ostringstream geturl;
+
+ u16 proto_version_min = g_settings->getFlag("send_pre_v25_init") ?
+ CLIENT_PROTOCOL_VERSION_MIN_LEGACY : CLIENT_PROTOCOL_VERSION_MIN;
+
geturl << g_settings->get("serverlist_url") <<
- "/list?proto_version_min=" << CLIENT_PROTOCOL_VERSION_MIN <<
+ "/list?proto_version_min=" << proto_version_min <<
"&proto_version_max=" << CLIENT_PROTOCOL_VERSION_MAX;
Json::Value root = fetchJsonValue(geturl.str(), NULL);
@@ -165,7 +169,7 @@ const std::string serialize(const std::vector<ServerListSpec> &serverlist)
std::string liststring;
for (std::vector<ServerListSpec>::const_iterator it = serverlist.begin();
it != serverlist.end();
- it++) {
+ ++it) {
liststring += "[server]\n";
liststring += (*it)["name"].asString() + '\n';
liststring += (*it)["address"].asString() + '\n';
@@ -182,7 +186,7 @@ const std::string serializeJson(const std::vector<ServerListSpec> &serverlist)
Json::Value list(Json::arrayValue);
for (std::vector<ServerListSpec>::const_iterator it = serverlist.begin();
it != serverlist.end();
- it++) {
+ ++it) {
list.append(*it);
}
root["list"] = list;