]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/serverlist.cpp
Enable mod security by default
[dragonfireclient.git] / src / serverlist.cpp
index a33d1d6bfeeef60661849345b3e56d34b553834b..87ca5dc04487c1ba5b74af2dd85b6449d744c66d 100644 (file)
@@ -29,7 +29,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #include "porting.h"
 #include "log.h"
 #include "network/networkprotocol.h"
-#include "json/json.h"
+#include <json/json.h>
 #include "convert_json.h"
 #include "httpfetch.h"
 #include "util/string.h"
@@ -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;