]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
download system:
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Apr 2008 11:07:19 +0000 (11:07 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 22 Apr 2008 11:07:19 +0000 (11:07 +0000)
- 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

index bbef89ce48d0ed25865d1a5dc79b0e1bb45730f3..ea2668acad7a9870cd9d6c1b8c7ca7f8040e9c82 100644 (file)
@@ -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)
                        {