* (bug 3019) adds the cvar cl_guidServerUniq (defaults to 1). When set to

non-zero, cl_guid will be unique for each server that the client
  connects to
This commit is contained in:
Tony J. White = 2007-02-12 18:52:15 +00:00
parent 046e86a925
commit 2cddf1208d
4 changed files with 88 additions and 17 deletions

View file

@ -257,9 +257,9 @@ static void MD5Final(struct MD5Context *ctx, unsigned char *digest)
}
char *Com_MD5File(const char *fn, int length)
char *Com_MD5File( const char *fn, int length, const char *prefix, int prefix_len )
{
static char final[33] = {"unknown"};
static char final[33] = {""};
unsigned char digest[16] = {""};
fileHandle_t f;
MD5_CTX md5;
@ -269,8 +269,15 @@ char *Com_MD5File(const char *fn, int length)
int r = 0;
int total = 0;
filelen = FS_FOpenFileRead(fn, &f, qtrue);
if(filelen < 1) {
Q_strncpyz( final, "", sizeof( final ) );
filelen = FS_SV_FOpenFileRead( fn, &f );
if( !f ) {
return final;
}
if( filelen < 1 ) {
FS_FCloseFile( f );
return final;
}
if(filelen < length || !length) {
@ -278,6 +285,10 @@ char *Com_MD5File(const char *fn, int length)
}
MD5Init(&md5);
if( prefix_len && *prefix )
MD5Update(&md5 , (unsigned char *)prefix, prefix_len);
for(;;) {
r = FS_Read2(buffer, sizeof(buffer), f);
if(r < 1)