From 733d21810f10c5eaccc7cf6c90e2629d3210a219 Mon Sep 17 00:00:00 2001 From: divverent Date: Thu, 8 Jan 2009 19:06:17 +0000 Subject: [PATCH] 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 --- cl_parse.c | 2 +- sv_main.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) 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; -- 2.39.2