Add a comment explaining how the compression algorithms are negotiated
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Jan 2009 19:06:17 +0000 (19:06 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 8 Jan 2009 19:06:17 +0000 (19:06 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8639 d7cf8633-e32d-0410-b094-e92efae38249

cl_parse.c
sv_main.c

index 55b832e..9bf2886 100644 (file)
@@ -995,7 +995,7 @@ void CL_BeginDownloads(qboolean aborteddownload)
                 && !FS_FileExists(va("dlcache/%s.%i.%i", csqc_progname.string, csqc_progsize.integer, csqc_progcrc.integer)))
                {
                        Con_Printf("Downloading new CSQC code to dlcache/%s.%i.%i\n", csqc_progname.string, csqc_progsize.integer, csqc_progcrc.integer);
-                       if(cl_serverextension_download.integer >= 2 && FS_HasZlib())
+                       if(cl_serverextension_download.integer == 2 && FS_HasZlib())
                                Cmd_ForwardStringToServer(va("download %s deflate", csqc_progname.string));
                        else
                                Cmd_ForwardStringToServer(va("download %s", csqc_progname.string));
index e0fd7e7..c35976f 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -2121,6 +2121,31 @@ static void SV_StartDownload_f(void)
                host_client->download_started = true;
 }
 
+/*
+ * Compression extension negotiation:
+ *
+ * Server to client:
+ *   cl_serverextension_download 2
+ *
+ * Client to server:
+ *   download <filename> <list of zero or more suppported compressions in order of preference>
+ * e.g.
+ *   download maps/map1.bsp lzo deflate huffman
+ *
+ * Server to client:
+ *   cl_downloadbegin <compressed size> <filename> <compression method actually used>
+ * e.g.
+ *   cl_downloadbegin 123456 maps/map1.bsp deflate
+ *
+ * The server may choose not to compress the file by sending no compression name, like:
+ *   cl_downloadbegin 345678 maps/map1.bsp
+ *
+ * NOTE: the "download" command may only specify compression algorithms if
+ *       cl_serverextension_download is 2!
+ *       If cl_serverextension_download has a different value, the client must
+ *       assume this extension is not supported!
+ */
+
 static void Download_CheckExtensions(void)
 {
        int i;