Dont announce server in singleplayer
authorproller <proller@github.com>
Sat, 27 Jul 2013 13:44:59 +0000 (17:44 +0400)
committerproller <proller@github.com>
Sat, 27 Jul 2013 13:51:34 +0000 (17:51 +0400)
src/convert_json.cpp
src/server.cpp

index 58eefd9015b9c9a6980203e21a01824920fa5da7..61db67fd55808a2cc907c81c956ca77f739c92da 100644 (file)
@@ -55,10 +55,11 @@ Json::Value                 fetchJsonValue(const std::string url,
                curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
                curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring);
                curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, g_settings->getS32("curl_timeout"));
+               curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, g_settings->getS32("curl_timeout"));
+
                if (chunk != 0)
                        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
 
-
                res = curl_easy_perform(curl);
                if (res != CURLE_OK)
                        errorstream<<"Jsonreader: "<< url <<" not found (" << curl_easy_strerror(res) << ")" <<std::endl;
index c5146658de73e2ec4add0a2c2228bf8b11354da7..6e31d288c541b94d346f9112f88b121f87265c5d 100644 (file)
@@ -1242,7 +1242,7 @@ void Server::AsyncRunStep()
        // send masterserver announce
        {
                float &counter = m_masterserver_timer;
-               if((!counter || counter >= 300.0) && g_settings->getBool("server_announce") == true)
+               if(!isSingleplayer() && (!counter || counter >= 300.0) && g_settings->getBool("server_announce") == true)
                {
                        ServerList::sendAnnounce(!counter ? "start" : "update", m_clients_number, m_uptime.get(), m_gamespec.id, m_mods);
                        counter = 0.01;