diff options
Diffstat (limited to 'code/client')
-rw-r--r-- | code/client/cl_curl.c | 3 | ||||
-rw-r--r-- | code/client/cl_main.c | 20 | ||||
-rw-r--r-- | code/client/cl_parse.c | 2 |
3 files changed, 20 insertions, 5 deletions
diff --git a/code/client/cl_curl.c b/code/client/cl_curl.c index a7f0879..170e97b 100644 --- a/code/client/cl_curl.c +++ b/code/client/cl_curl.c @@ -332,8 +332,7 @@ void CL_cURL_PerformDownload(void) qcurl_easy_strerror(msg->data.result), code, clc.downloadURL); } - *clc.downloadTempName = *clc.downloadName = 0; - Cvar_Set( "cl_downloadName", "" ); + CL_NextDownload(); } #endif /* USE_CURL */ diff --git a/code/client/cl_main.c b/code/client/cl_main.c index f435be0..029dba4 100644 --- a/code/client/cl_main.c +++ b/code/client/cl_main.c @@ -1916,11 +1916,25 @@ CL_NextDownload A download completed or failed ================= */ -void CL_NextDownload(void) { +void CL_NextDownload(void) +{ char *s; char *remoteName, *localName; qboolean useCURL = qfalse; + // A download has finished, check whether this matches a referenced checksum + if(*clc.downloadName) + { + char *zippath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), clc.downloadName, ""); + zippath[strlen(zippath)-1] = '\0'; + + if(!FS_CompareZipChecksum(zippath)) + Com_Error(ERR_DROP, "Incorrect checksum for file: %s", clc.downloadName); + } + + *clc.downloadTempName = *clc.downloadName = 0; + Cvar_Set("cl_downloadName", ""); + // We are looking to start a download here if (*clc.downloadList) { s = clc.downloadList; @@ -2027,6 +2041,10 @@ void CL_InitDownloads(void) { if ( *clc.downloadList ) { // if autodownloading is not enabled on the server cls.state = CA_CONNECTED; + + *clc.downloadTempName = *clc.downloadName = 0; + Cvar_Set( "cl_downloadName", "" ); + CL_NextDownload(); return; } diff --git a/code/client/cl_parse.c b/code/client/cl_parse.c index 588fe39..687cb5f 100644 --- a/code/client/cl_parse.c +++ b/code/client/cl_parse.c @@ -619,8 +619,6 @@ void CL_ParseDownload ( msg_t *msg ) { // rename the file FS_SV_Rename ( clc.downloadTempName, clc.downloadName ); } - *clc.downloadTempName = *clc.downloadName = 0; - Cvar_Set( "cl_downloadName", "" ); // send intentions now // We need this because without it, we would hold the last nextdl and then start |