From: divverent Date: Thu, 8 Jan 2009 19:06:17 +0000 (+0000) Subject: Add a comment explaining how the compression algorithms are negotiated X-Git-Tag: xonotic-v0.1.0preview~1953 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=733d21810f10c5eaccc7cf6c90e2629d3210a219;p=xonotic%2Fdarkplaces.git Add a comment explaining how the compression algorithms are negotiated git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8639 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cl_parse.c b/cl_parse.c index 55b832ef..9bf28867 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -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)); diff --git a/sv_main.c b/sv_main.c index e0fd7e76..c35976fe 100644 --- 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 + * e.g. + * download maps/map1.bsp lzo deflate huffman + * + * Server to client: + * cl_downloadbegin + * 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;