[iortcw] 485/497: MP: Fix downloading from an update server

Simon McVittie smcv at debian.org
Fri Sep 8 10:38:02 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 488923d0eebb77efc53598f9f40323b0b7a90bfc
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Sun Dec 20 15:09:27 2015 -0500

    MP: Fix downloading from an update server
---
 MP/code/client/cl_main.c   |  2 +-
 MP/code/qcommon/files.c    |  2 ++
 MP/code/qcommon/qcommon.h  | 12 +++++++-----
 MP/code/server/sv_client.c | 11 ++++++++---
 4 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/MP/code/client/cl_main.c b/MP/code/client/cl_main.c
index 215f103..c6dea1c 100644
--- a/MP/code/client/cl_main.c
+++ b/MP/code/client/cl_main.c
@@ -2324,7 +2324,7 @@ void CL_NextDownload(void)
 	qboolean useCURL = qfalse;
 
 	// A download has finished, check whether this matches a referenced checksum
-	if(*clc.downloadName)
+	if( *clc.downloadName && !autoupdateStarted )
 	{
 		char *zippath = FS_BuildOSPath(Cvar_VariableString("fs_homepath"), clc.downloadName, "");
 		zippath[strlen(zippath)-1] = '\0';
diff --git a/MP/code/qcommon/files.c b/MP/code/qcommon/files.c
index 02da298..71cd350 100644
--- a/MP/code/qcommon/files.c
+++ b/MP/code/qcommon/files.c
@@ -4204,8 +4204,10 @@ void FS_InitFilesystem( void ) {
 	FS_Startup(com_basegame->string);
 
 #ifndef STANDALONE
+#ifndef UPDATE_SERVER
 	FS_CheckPak0( );
 #endif
+#endif
 
 #ifndef UPDATE_SERVER
 	// if we can't find default.cfg, assume that the paths are
diff --git a/MP/code/qcommon/qcommon.h b/MP/code/qcommon/qcommon.h
index 5b0b871..fe5fa79 100644
--- a/MP/code/qcommon/qcommon.h
+++ b/MP/code/qcommon/qcommon.h
@@ -295,14 +295,14 @@ You or the server may be running older versions of the game. Press the auto-upda
 // NOTE: that stuff only works with two digits protocols
 extern int demo_protocols[];
 
-#if !defined UPDATE_SERVER_NAME && !defined STANDALONE
 // NERVE - SMF - wolf multiplayer master servers
-#define UPDATE_SERVER_NAME      "wolfmotd.idsoftware.com"            // 192.246.40.65
+#if !defined UPDATE_SERVER_NAME && !defined STANDALONE
+#define UPDATE_SERVER_NAME		"wolfmotd.idsoftware.com"	// 192.246.40.65
 #endif
 
 #ifndef MASTER_SERVER_NAME
-//#define MASTER_SERVER_NAME      "wolfmaster.idsoftware.com"	// Official master server decommissioned
-#define MASTER_SERVER_NAME      "dpmaster.deathmask.net"
+//#define MASTER_SERVER_NAME		"wolfmaster.idsoftware.com"	// Official master server decommissioned
+#define MASTER_SERVER_NAME		"dpmaster.deathmask.net"
 #endif
 
 #ifndef STANDALONE
@@ -310,10 +310,12 @@ extern int demo_protocols[];
     #define	AUTHORIZE_SERVER_NAME	"wolfauthorize.idsoftware.com"
   #endif
   #ifndef PORT_AUTHORIZE
-  #define	PORT_AUTHORIZE		27952
+    #define	PORT_AUTHORIZE		27952
   #endif
 #endif
 
+//#define AUTOUPDATE_SERVER_NAME	"foobar"
+
 #if !defined AUTOUPDATE_SERVER_NAME && !defined STANDALONE
 // TTimo: allow override for easy dev/testing..
 // see cons -- update_server=myhost
diff --git a/MP/code/server/sv_client.c b/MP/code/server/sv_client.c
index e604ea6..d74de7e 100644
--- a/MP/code/server/sv_client.c
+++ b/MP/code/server/sv_client.c
@@ -958,6 +958,7 @@ int SV_WriteDownloadToClient( client_t *cl, msg_t *msg ) {
 		return 0;
 	}
 
+#ifndef UPDATE_SERVER
 	// CVE-2006-2082
 	// validate the download against the list of pak files
 	if ( !FS_VerifyPak( cl->downloadName ) ) {
@@ -965,6 +966,7 @@ int SV_WriteDownloadToClient( client_t *cl, msg_t *msg ) {
 		SV_DropClient( cl, "illegal download request" );
 		return 0;
 	}
+#endif
 
 	if(!cl->download)
 	{
@@ -1004,8 +1006,6 @@ int SV_WriteDownloadToClient( client_t *cl, msg_t *msg ) {
 			}
 		}
 
-		cl->download = 0;
-
 		// DHM - Nerve :: Update server only allows files that are in versionmap.cfg to download
 #ifdef UPDATE_SERVER
 		for ( i = 0; i < numVersions; i++ ) {
@@ -1034,10 +1034,15 @@ int SV_WriteDownloadToClient( client_t *cl, msg_t *msg ) {
 #endif
 		// DHM - Nerve
 
+		cl->download = 0;
+
 		// We open the file here
 		if ( !(sv_allowDownload->integer & DLF_ENABLE) ||
 			(sv_allowDownload->integer & DLF_NO_UDP) ||
-			idPack || unreferenced ||
+			idPack ||
+#ifndef UPDATE_SERVER
+			unreferenced ||
+#endif
 			( cl->downloadSize = FS_SV_FOpenFileRead( cl->downloadName, &cl->download ) ) < 0 ) {
 			// cannot auto-download file
 			if(unreferenced)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list