@@ -232,6 +232,19 @@ bool CResourceManager::IsResourceFile( const SString& strInFilename )
232
232
return MapContains ( m_ResourceFileMap, strFilename );
233
233
}
234
234
235
+ // Remove this file from the checks as it has been changed by script actions
236
+ void CResourceManager::FileModifedByScript ( const SString& strInFilename )
237
+ {
238
+ SString strFilename = PathConform ( strInFilename ).ToLower ();
239
+ CDownloadableResource* pResourceFile = MapFindRef ( m_ResourceFileMap, strFilename );
240
+ if ( pResourceFile )
241
+ {
242
+ SString strMessage ( " Resource file modifed by script: %s " , *ConformResourcePath ( strInFilename ) );
243
+ AddReportLog ( 7059 , strMessage + g_pNet->GetConnectedServer ( true ), 10 );
244
+ MapRemove ( m_ResourceFileMap, strFilename );
245
+ }
246
+ }
247
+
235
248
// Check resource file data matches server checksum
236
249
void CResourceManager::ValidateResourceFile ( const SString& strInFilename, const CBuffer& fileData )
237
250
{
@@ -259,7 +272,7 @@ void CResourceManager::ValidateResourceFile( const SString& strInFilename, const
259
272
CMD5Hasher::ConvertToHex ( checksum.md5 , szMd5 );
260
273
char szMd5Wanted[33 ];
261
274
CMD5Hasher::ConvertToHex ( pResourceFile->GetServerChecksum ().md5 , szMd5Wanted );
262
- SString strMessage ( " Resource file checksum failed: %s [Size:%d MD5:%s][Wanted:%s][datasize:%d]" , *ConformResourcePath ( strInFilename ), (int )FileSize ( strInFilename ), szMd5, szMd5Wanted, fileData.GetSize () );
275
+ SString strMessage ( " Resource file checksum failed: %s [Size:%d MD5:%s][Wanted:%s][datasize:%d] " , *ConformResourcePath ( strInFilename ), (int )FileSize ( strInFilename ), szMd5, szMd5Wanted, fileData.GetSize () );
263
276
g_pClientGame->TellServerSomethingImportant ( 1007 , strMessage, false );
264
277
g_pCore->GetConsole ()->Print ( strMessage );
265
278
AddReportLog ( 7057 , strMessage + g_pNet->GetConnectedServer ( true ), 10 );
@@ -269,7 +282,7 @@ void CResourceManager::ValidateResourceFile( const SString& strInFilename, const
269
282
{
270
283
char szMd5[33 ];
271
284
CMD5Hasher::ConvertToHex ( checksum.md5 , szMd5 );
272
- SString strMessage ( " Attempt to load resource file before it is ready: %s [Size:%d MD5:%s]" , *ConformResourcePath ( strInFilename ), (int )FileSize ( strInFilename ), szMd5 );
285
+ SString strMessage ( " Attempt to load resource file before it is ready: %s [Size:%d MD5:%s] " , *ConformResourcePath ( strInFilename ), (int )FileSize ( strInFilename ), szMd5 );
273
286
g_pClientGame->TellServerSomethingImportant ( 1008 , strMessage, false );
274
287
g_pCore->GetConsole ()->Print ( strMessage );
275
288
AddReportLog ( 7058 , strMessage + g_pNet->GetConnectedServer ( true ), 10 );
0 commit comments