From: proller Date: Sat, 27 Jul 2013 13:44:59 +0000 (+0400) Subject: Dont announce server in singleplayer X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=e65d8ad6553d7ae0acf63b43e9818059088a00b6;p=zefram%2Fminetest%2Fminetest_engine.git Dont announce server in singleplayer --- diff --git a/src/convert_json.cpp b/src/convert_json.cpp index 58eefd90..61db67fd 100644 --- a/src/convert_json.cpp +++ b/src/convert_json.cpp @@ -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) << ")" <= 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;