Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Dont announce server in singleplayer
- Loading branch information
Showing
with
3 additions
and
2 deletions.
-
+2
−1
src/convert_json.cpp
-
+1
−1
src/server.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) << ")" <<std::endl; |
|
|
|
@@ -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; |
|
|