From 211044c3ab7658ceeda7fac58efea101108a907e Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 22 Apr 2008 11:07:19 +0000 Subject: [PATCH] download system: - Nexuiz: only download csprogs using it for now; always put downloads in dlcache/ - other games: make CSQC always go into dlcache/ git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8264 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_parse.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cl_parse.c b/cl_parse.c index bbef89ce..ea2668ac 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -1040,6 +1040,16 @@ void CL_BeginDownloads(qboolean aborteddownload) // finished loading sounds } + if(gamemode == GAME_NEXUIZ) + goto skipdownloads; + // in Nexuiz, the built in download protocol is kinda broken (misses lots + // of dependencies) anyway, and can mess around with the game directory; + // until this is fixed, only support pk3 downloads via curl, and turn off + // individual file downloads other than for CSQC + // on the other end of the download protocol, GAME_NEXUIZ enforces writing + // to dlcache only + // idea: support download of pk3 files using this protocol later + // note: the reason these loops skip already-loaded things is that it // enables this command to be issued during the game if desired @@ -1136,6 +1146,7 @@ void CL_BeginDownloads(qboolean aborteddownload) // finished loading sounds } +skipdownloads: if (!cl.loadfinished) { cl.loadfinished = true; @@ -1171,7 +1182,8 @@ void CL_StopDownload(int size, int crc) // save to disk only if we don't already have it // (this is mainly for playing back demos) existingcrc = FS_CRCFile(cls.qw_downloadname, &existingsize); - if (existingsize) + if (existingsize || gamemode == GAME_NEXUIZ || !strcmp(cls.qw_downloadname, csqc_progname.string)) + // let csprogs ALWAYS go to dlcache, to prevent "viral csprogs"; also, never put files outside dlcache for Nexuiz { if ((int)existingsize != size || existingcrc != crc) { -- 2.39.2