Skip to content

Commit e65d8ad

Browse files
committedJul 27, 2013
Dont announce server in singleplayer
1 parent 215e37a commit e65d8ad

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
 

‎src/convert_json.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ Json::Value fetchJsonValue(const std::string url,
5555
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
5656
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &liststring);
5757
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, g_settings->getS32("curl_timeout"));
58+
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, g_settings->getS32("curl_timeout"));
59+
5860
if (chunk != 0)
5961
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
6062

61-
6263
res = curl_easy_perform(curl);
6364
if (res != CURLE_OK)
6465
errorstream<<"Jsonreader: "<< url <<" not found (" << curl_easy_strerror(res) << ")" <<std::endl;

‎src/server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ void Server::AsyncRunStep()
12421242
// send masterserver announce
12431243
{
12441244
float &counter = m_masterserver_timer;
1245-
if((!counter || counter >= 300.0) && g_settings->getBool("server_announce") == true)
1245+
if(!isSingleplayer() && (!counter || counter >= 300.0) && g_settings->getBool("server_announce") == true)
12461246
{
12471247
ServerList::sendAnnounce(!counter ? "start" : "update", m_clients_number, m_uptime.get(), m_gamespec.id, m_mods);
12481248
counter = 0.01;

0 commit comments

Comments
 (0)
Please sign in to comment.