summaryrefslogtreecommitdiff
path: root/src/client/main.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2013-02-18 15:48:35 +0400
committerAndrey Nazarov <skuller@skuller.net>2013-02-18 16:27:42 +0400
commit5a1ece6a2775a7c589f82b4979da210bc1168e4a (patch)
tree8ade1712ed3589794fba137b14d433b6feebda43 /src/client/main.c
parent45fba018d464879cd6216d55212b7ce9b5b61613 (diff)
Add ‘cl_http_default_url’ variable.
Allow default repository URL to be defined for servers that don't specify one. Any 404 from default repository is treated as fatal error, permitting the client to revert to UDP downloading from the game server.
Diffstat (limited to 'src/client/main.c')
-rw-r--r--src/client/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/client/main.c b/src/client/main.c
index 3bac2e2..23261f0 100644
--- a/src/client/main.c
+++ b/src/client/main.c
@@ -1392,6 +1392,7 @@ static void CL_ConnectionlessPacket(void)
netchan_type_t type;
int anticheat = 0;
char mapname[MAX_QPATH];
+ qboolean got_server = qfalse;
if (cls.state < ca_connecting) {
Com_DPrintf("Connect received while not connecting. Ignored.\n");
@@ -1435,10 +1436,17 @@ static void CL_ConnectionlessPacket(void)
} else if (!strncmp(s, "map=", 4)) {
Q_strlcpy(mapname, s + 4, sizeof(mapname));
} else if (!strncmp(s, "dlserver=", 9)) {
- HTTP_SetServer(s + 9);
+ if (!got_server) {
+ HTTP_SetServer(s + 9);
+ got_server = qtrue;
+ }
}
}
+ if (!got_server) {
+ HTTP_SetServer(NULL);
+ }
+
Com_Printf("Connected to %s (protocol %d).\n",
NET_AdrToString(&cls.serverAddress), cls.serverProtocol);
if (cls.netchan) {