@@ -232,6 +232,19 @@ bool CResourceManager::IsResourceFile( const SString& strInFilename )
232232 return MapContains ( m_ResourceFileMap, strFilename );
233233}
234234
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+
235248// Check resource file data matches server checksum
236249void CResourceManager::ValidateResourceFile ( const SString& strInFilename, const CBuffer& fileData )
237250{
@@ -259,7 +272,7 @@ void CResourceManager::ValidateResourceFile( const SString& strInFilename, const
259272 CMD5Hasher::ConvertToHex ( checksum.md5 , szMd5 );
260273 char szMd5Wanted[33 ];
261274 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 () );
263276 g_pClientGame->TellServerSomethingImportant ( 1007 , strMessage, false );
264277 g_pCore->GetConsole ()->Print ( strMessage );
265278 AddReportLog ( 7057 , strMessage + g_pNet->GetConnectedServer ( true ), 10 );
@@ -269,7 +282,7 @@ void CResourceManager::ValidateResourceFile( const SString& strInFilename, const
269282 {
270283 char szMd5[33 ];
271284 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 );
273286 g_pClientGame->TellServerSomethingImportant ( 1008 , strMessage, false );
274287 g_pCore->GetConsole ()->Print ( strMessage );
275288 AddReportLog ( 7058 , strMessage + g_pNet->GetConnectedServer ( true ), 10 );
0 commit comments