Skip to content

Commit

Permalink
Fixed|Network|Client: Ignore master server actions if no API URL set
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Oct 19, 2015
1 parent 4c88a3f commit 68c4b67
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doomsday/apps/client/src/network/masterserver.cpp
@@ -1,4 +1,4 @@
/** @file masterserver.cpp Communication with the Master Server.
/** @file masterserver.cpp Communication with the Master Server.
* @ingroup network
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
Expand Down Expand Up @@ -51,9 +51,10 @@ static String const DEFAULT_API_URL = "www.dengine.net/master.php";

dd_bool masterAware = false; // cvar

static QString masterUrl(const char* suffix = 0)
static QString masterUrl(char const *suffix = 0)
{
String u = App::config().gets("masterServer.apiUrl", DEFAULT_API_URL);
if(u.isEmpty()) return u;
if(!u.startsWith("http")) u = "http://" + u;
if(suffix) u += suffix;
return u;
Expand Down Expand Up @@ -88,6 +89,8 @@ void MasterWorker::newJob(Action action, void* data)
{
LOG_AS("MasterWorker");

if(masterUrl().isEmpty()) return;

job_t job;
job.act = action;
job.data = data;
Expand Down

0 comments on commit 68c4b67

Please sign in to comment.