[quake3] pk3 limit

panter at gmx.de panter at gmx.de
Sat Sep 2 15:49:08 EDT 2006


well, ive 528 pk3 files on a server (baseq3+defrag directory) and if i try to connect to it my client is crashing with or without that patch.

-------- Original-Nachricht --------
Datum: Sat, 2 Sep 2006 15:05:30 +0200
Von: Ludwig Nussel <ludwig.nussel at suse.de>
An: quake3 at icculus.org
Betreff: Re: [quake3] pk3 limit

> panter at gmx.de wrote:
> > in the mod defrag its normal to have more than 500 pk3 files.
> > is there a way to increase the pk3 count? i want quake to be able to
> handle up to 2000.
> 
> The pk3 file limit seems to be artificial. Try the following patch.
> 
> cu
> Ludwig
> 
> Index: code/qcommon/files.c
> ===================================================================
> --- code/qcommon/files.c	(Revision 883)
> +++ code/qcommon/files.c	(Arbeitskopie)
> @@ -2483,7 +2483,6 @@
>  then loads the zip headers
>  ================
>  */
> -#define	MAX_PAKFILES	1024
>  static void FS_AddGameDirectory( const char *path, const char *dir ) {
>  	searchpath_t	*sp;
>  	int				i;
> @@ -2492,7 +2491,6 @@
>  	char			*pakfile;
>  	int				numfiles;
>  	char			**pakfiles;
> -	char			*sorted[MAX_PAKFILES];
>  
>  	// this fixes the case where fs_basepath is the same as fs_cdpath
>  	// which happens on full installs
> @@ -2521,20 +2519,11 @@
>  
>  	pakfiles = Sys_ListFiles( pakfile, ".pk3", NULL, &numfiles, qfalse );
>  
> -	// sort them so that later alphabetic matches override
> -	// earlier ones.  This makes pak1.pk3 override pak0.pk3
> -	if ( numfiles > MAX_PAKFILES ) {
> -		numfiles = MAX_PAKFILES;
> -	}
> -	for ( i = 0 ; i < numfiles ; i++ ) {
> -		sorted[i] = pakfiles[i];
> -	}
> +	qsort( pakfiles, numfiles, sizeof(char*), paksort );
>  
> -	qsort( sorted, numfiles, sizeof(char*), paksort );
> -
>  	for ( i = 0 ; i < numfiles ; i++ ) {
> -		pakfile = FS_BuildOSPath( path, dir, sorted[i] );
> -		if ( ( pak = FS_LoadZipFile( pakfile, sorted[i] ) ) == 0 )
> +		pakfile = FS_BuildOSPath( path, dir, pakfiles[i] );
> +		if ( ( pak = FS_LoadZipFile( pakfile, pakfiles[i] ) ) == 0 )
>  			continue;
>  		// store the game name for downloading
>  		strcpy(pak->pakGamename, dir);
> 
> -- 
>  (o_   Ludwig Nussel
>  //\   SUSE LINUX Products GmbH, Development
>  V_/_  http://www.suse.de/

-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail



More information about the quake3 mailing list