diff --git a/src/filesystem.c b/src/filesystem.c index b5439d7d..9f482ddf 100644 --- a/src/filesystem.c +++ b/src/filesystem.c @@ -3969,12 +3969,17 @@ void FS_ReferencedPaks(char *outChkSums, char *outPathNames, int maxlen) char chkSumString[8192]; char pathString[8192]; char chksum[1024]; + char singlepath[1024]; chkSumString[0] = 0; pathString[0] = 0; for ( puresum = fs_iwdPureChecks; puresum; puresum = puresum->next ) { + if(fs_gameDirVar->string[0] && !Q_stricmp(puresum->gameName, fs_gameDirVar->string)) + { + continue; + } Com_sprintf(chksum, sizeof(chksum), "%i ", puresum->checksum); Q_strncat(chkSumString, sizeof(chkSumString), chksum); if ( pathString[0] ) @@ -3988,26 +3993,27 @@ void FS_ReferencedPaks(char *outChkSums, char *outPathNames, int maxlen) if ( fs_gameDirVar->string[0] ) { - for ( search = fs_searchpaths; search; search = search->next ) - { - if ( search->pack && !search->localized ) - { - if ( !(search->pack->referenced & FS_GENERAL_REF) && - (!Q_stricmp(search->pack->pakGamename, fs_gameDirVar->string) || !Q_stricmpn(search->pack->pakGamename, "usermaps", 8)) - ) - { - Com_sprintf(chksum, sizeof(chksum), "%i ", search->pack->checksum); - Q_strncat(chkSumString, sizeof(chkSumString), chksum); - if ( pathString[0] ) + for ( search = fs_searchpaths; search; search = search->next ) + { + if ( search->pack && !search->localized ) + { + //!(search->pack->referenced & FS_GENERAL_REF) && + if ( strstr( search->pack->pakBasename, "_svr_") == NULL && + (!Q_stricmp(search->pack->pakGamename, fs_gameDirVar->string) || !Q_stricmpn(search->pack->pakGamename, "usermaps", 8))) { - Q_strncat(pathString, sizeof(pathString), " "); - } - Q_strncat(pathString, sizeof(pathString), search->pack->pakGamename); - Q_strncat(pathString, sizeof(pathString), "/"); - Q_strncat(pathString, sizeof(pathString), search->pack->pakBasename); - } + Com_sprintf(chksum, sizeof(chksum), "%i ", search->pack->checksum); + Q_strfrontcat(chkSumString, sizeof(chkSumString), chksum); + singlepath[0] = 0; + + Q_strncat(singlepath, sizeof(singlepath), search->pack->pakGamename); + Q_strncat(singlepath, sizeof(singlepath), "/"); + Q_strncat(singlepath, sizeof(singlepath), search->pack->pakBasename); + Q_strncat(singlepath, sizeof(singlepath), " "); + + Q_strfrontcat(pathString, sizeof(pathString), singlepath); } - } + } + } } Q_strncpyz(outChkSums, chkSumString, maxlen); diff --git a/src/q_shared.h b/src/q_shared.h index db83d683..b6390944 100644 --- a/src/q_shared.h +++ b/src/q_shared.h @@ -248,6 +248,7 @@ int QDECL Com_sprintf(char *dest, int size, const char *fmt, ...); void Q_strchrrepl(char *string, char torepl, char repl); char* Q_BitConv(int val); int Q_strLF2CRLF(const char* input, char* output, int outputlimit ); +void Q_strfrontcat(char *dest, int size, const char* src); #ifndef BSPC char* va( const char *format, ... ); diff --git a/src/qshared.c b/src/qshared.c index a9e97d70..689f538c 100644 --- a/src/qshared.c +++ b/src/qshared.c @@ -305,6 +305,20 @@ void Q_strncat( char *dest, int size, const char *src ) { Q_strncpyz( dest + l1, src, size - l1 ); } +// never goes past bounds or leaves without a terminating 0, inserts string at front position +void Q_strfrontcat( char *dest, int size, const char *src ) { + int ld; + int ls; + + ld = strlen( dest ); + ls = strlen( src ); + + if ( ld + ls >= size ) { + Com_Error( ERR_FATAL, "Q_strpushfront: overflowed" ); + } + memmove(dest + ls, dest, ld +1); + memcpy(dest, src, ls); +} /* ============= diff --git a/src/sv_client.c b/src/sv_client.c index 1ec1b55b..9ecc7501 100644 --- a/src/sv_client.c +++ b/src/sv_client.c @@ -2702,7 +2702,7 @@ client_t* SV_ReadPackets(netadr_t *from, unsigned short qport) // some address translating routers periodically change UDP // port assignments if ( cl->netchan.remoteAddress.port != from->port ) { - Com_Printf(CON_CHANNEL_SERVER, "SV_ReceiveStats: fixing up a translated port\n" ); +// Com_Printf(CON_CHANNEL_SERVER, "SV_ReceiveStats: fixing up a translated port\n" ); //Some ISPs became terrible with their CGNAT - we don't wanna see this anymore cl->netchan.remoteAddress.port = from->port; } return cl; diff --git a/src/version/version.c b/src/version/version.c index fcc4199b..7c26a0d8 100644 --- a/src/version/version.c +++ b/src/version/version.c @@ -1,6 +1,6 @@ #include "version.h" -#define SYS_COMMONVERSION 20.0 +#define SYS_COMMONVERSION 20.1 #define _STRINGIFY(s) #s #define STRINGIFY(s) _STRINGIFY(s)