Skip to content

Commit

Permalink
files 20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Beasty committed Aug 2, 2021
1 parent 29a1693 commit c806471
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 20 deletions.
42 changes: 24 additions & 18 deletions src/filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] )
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/q_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -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, ... );
Expand Down
14 changes: 14 additions & 0 deletions src/qshared.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
=============
Expand Down
2 changes: 1 addition & 1 deletion src/sv_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/version/version.c
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit c806471

Please sign in to comment.