2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 18:07:09 +01:00

engine: client: allow reading upper directories for clc_fileconsistency. Initialize md5 digest, add note about servers relying on uninitialized md5 value in some cases.

This commit is contained in:
Alibek Omarov 2024-10-26 05:17:24 +03:00
parent 49990a0859
commit 667bedab82

View File

@ -1617,7 +1617,7 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto )
vec3_t mins, maxs;
string filename;
CRC32_t crcFile;
byte md5[16];
byte md5[16] = { 0 };
consistency_t *pc;
int i, pos;
@ -1633,6 +1633,8 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto )
MSG_StartBitWriting( msg );
}
FS_AllowDirectPaths( true );
for( i = 0; i < cl.num_consistency; i++ )
{
qboolean have_file = true;
@ -1661,6 +1663,8 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto )
switch( pc->check_type )
{
case force_exactfile:
// servers rely on md5 not being initialized after previous file
// if current file doesn't exist
MD5_HashFile( md5, filename, NULL );
memcpy( &pc->value, md5, sizeof( pc->value ));
LittleLongSW( pc->value );
@ -1709,6 +1713,8 @@ static void CL_SendConsistencyInfo( sizebuf_t *msg, connprotocol_t proto )
}
}
FS_AllowDirectPaths( false );
MSG_WriteOneBit( msg, 0 );
if( proto == PROTO_GOLDSRC )