Remove prioritization of pak file download.

We aren't in 1997 anymore, todays broadband connections are fast enough
to handle multiple large files. This may download some assets twice if
the server provides both a pak file with all assets and the assets as
plain files.
This commit is contained in:
Yamagi Burmeister 2018-12-05 18:51:58 +01:00
parent df82598984
commit 7f085db431

View file

@ -46,7 +46,6 @@ static CURLM *multi = NULL;
static int handleCount = 0;
static int pendingCount = 0;
static int abortDownloads = HTTPDL_ABORT_NONE;
static qboolean downloading_pak = false; // TODO CURL: Rausreißen?
static qboolean httpDown = false;
static qboolean thisMapAbort = false; // TODO CURL: Raußreißen?
@ -565,13 +564,6 @@ static void CL_FinishHTTPDownload(void)
{
i = strlen(dl->queueEntry->quakePath);
// These must be consistent with fs_packtypes in filesystem.c.
if (!strcmp(dl->queueEntry->quakePath + i - 4, ".pak") || !strcmp(dl->queueEntry->quakePath + i - 4, ".pk2") ||
!strcmp(dl->queueEntry->quakePath + i - 4, ".pk3") || !strcmp(dl->queueEntry->quakePath + i - 4, ".zip"))
{
downloading_pak = false;
}
// We got a 404, remove the target file.
if (isFile)
{
@ -647,13 +639,6 @@ static void CL_FinishHTTPDownload(void)
i = strlen(dl->queueEntry->quakePath);
// These must be consistent with fs_packtypes in filesystem.c.
if (!strcmp(dl->queueEntry->quakePath + i - 4, ".pak") || !strcmp(dl->queueEntry->quakePath + i - 4, ".pk2") ||
!strcmp(dl->queueEntry->quakePath + i - 4, ".pk3") || !strcmp(dl->queueEntry->quakePath + i - 4, ".zip"))
{
downloading_pak = false;
}
// The download failed. Remove the temporary file...
if (isFile)
{
@ -683,8 +668,6 @@ static void CL_FinishHTTPDownload(void)
{
FS_AddPAKFromGamedir(dl->queueEntry->quakePath);
CL_ReVerifyHTTPQueue ();
downloading_pak = false;
}
}
@ -764,15 +747,6 @@ static void CL_StartNextHTTPDownload(void)
CL_StartHTTPDownload(q, dl);
// These must be consistent with fs_packtypes in filesystem.c.
size_t len = strlen (q->quakePath);
if (!strcmp(dl->queueEntry->quakePath + len - 4, ".pak") || !strcmp(dl->queueEntry->quakePath + len - 4, ".pk2") ||
!strcmp(dl->queueEntry->quakePath + len- 4, ".pk3") || !strcmp(dl->queueEntry->quakePath + len - 4, ".zip"))
{
downloading_pak = true;
}
break;
}
}
@ -1070,7 +1044,7 @@ void CL_RunHTTPDownloads(void)
// Not enough downloads running, start some more.
if (pendingCount && abortDownloads == HTTPDL_ABORT_NONE &&
!downloading_pak && handleCount < cl_http_max_connections->value)
handleCount < cl_http_max_connections->value)
{
CL_StartNextHTTPDownload();
}