@@ -4883,62 +4883,58 @@ void CPacketHandler::Packet_ResourceStart ( NetBitStreamInterface& bitStream )
4883
4883
if ( uiTotalSizeProcessed / 1024 / 1024 > 50 )
4884
4884
g_pCore->UpdateDummyProgress ( uiTotalSizeProcessed / 1024 / 1024 , " MB" );
4885
4885
4886
- // Don't bother with empty files
4887
- if ( dChunkDataSize > 0 )
4886
+ // Create the resource downloadable
4887
+ CDownloadableResource* pDownloadableResource = NULL ;
4888
+ switch ( ucChunkSubType )
4888
4889
{
4889
- // Create the resource downloadable
4890
- CDownloadableResource* pDownloadableResource = NULL ;
4891
- switch ( ucChunkSubType )
4892
- {
4893
- case CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_FILE:
4894
- {
4895
- bool bDownload = bitStream.ReadBit ();
4896
- pDownloadableResource = pResource->QueueFile ( CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_FILE, szChunkData, chunkChecksum, bDownload );
4897
-
4898
- break ;
4899
- }
4900
- case CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_SCRIPT:
4901
- pDownloadableResource = pResource->QueueFile ( CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_SCRIPT, szChunkData, chunkChecksum );
4890
+ case CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_FILE:
4891
+ {
4892
+ bool bDownload = bitStream.ReadBit ();
4893
+ pDownloadableResource = pResource->QueueFile ( CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_FILE, szChunkData, chunkChecksum, bDownload );
4902
4894
4903
4895
break ;
4904
- case CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_CONFIG:
4905
- pDownloadableResource = pResource->AddConfigFile ( szChunkData, chunkChecksum );
4896
+ }
4897
+ case CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_SCRIPT:
4898
+ pDownloadableResource = pResource->QueueFile ( CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_SCRIPT, szChunkData, chunkChecksum );
4906
4899
4907
- break ;
4908
- default :
4900
+ break ;
4901
+ case CDownloadableResource::RESOURCE_FILE_TYPE_CLIENT_CONFIG:
4902
+ pDownloadableResource = pResource->AddConfigFile ( szChunkData, chunkChecksum );
4909
4903
4910
- break ;
4904
+ break ;
4905
+ default :
4906
+
4907
+ break ;
4908
+ }
4909
+
4910
+ // Does the Client and Server checksum differ?
4911
+ if ( pDownloadableResource && !pDownloadableResource->DoesClientAndServerChecksumMatch () )
4912
+ {
4913
+ // Delete the file that already exists
4914
+ FileDelete ( pDownloadableResource->GetName () );
4915
+ if ( FileExists ( pDownloadableResource->GetName () ) )
4916
+ {
4917
+ SString strMessage ( " Unable to delete old file %s" , *ConformResourcePath ( pDownloadableResource->GetName () ) );
4918
+ g_pClientGame->TellServerSomethingImportant ( 1009 , strMessage, false );
4911
4919
}
4912
4920
4913
- // Does the Client and Server checksum differ ?
4914
- if ( pDownloadableResource && !pDownloadableResource-> DoesClientAndServerChecksumMatch () )
4921
+ // Is it downloadable now ?
4922
+ if ( pDownloadableResource-> IsAutoDownload () )
4915
4923
{
4916
- // Delete the file that already exists
4917
- FileDelete ( pDownloadableResource->GetName () );
4918
- if ( FileExists ( pDownloadableResource-> GetName () ) )
4924
+ // Make sure the directory exists
4925
+ const char * szTempName = pDownloadableResource->GetName ();
4926
+ if ( szTempName )
4919
4927
{
4920
- SString strMessage ( " Unable to delete old file %s " , * ConformResourcePath ( pDownloadableResource-> GetName () ) );
4921
- g_pClientGame-> TellServerSomethingImportant ( 1009 , strMessage, false );
4928
+ // Make sure its directory exists
4929
+ MakeSureDirExists ( szTempName );
4922
4930
}
4923
4931
4924
- // Is it downloadable now?
4925
- if ( pDownloadableResource->IsAutoDownload () )
4926
- {
4927
- // Make sure the directory exists
4928
- const char * szTempName = pDownloadableResource->GetName ();
4929
- if ( szTempName )
4930
- {
4931
- // Make sure its directory exists
4932
- MakeSureDirExists ( szTempName );
4933
- }
4932
+ // Combine the HTTP Download URL, the Resource Name and the Resource File
4933
+ SString strHTTPDownloadURLFull ( " %s/%s/%s" , g_pClientGame->m_strHTTPDownloadURL .c_str (), pResource->GetName (), pDownloadableResource->GetShortName () );
4934
4934
4935
- // Combine the HTTP Download URL, the Resource Name and the Resource File
4936
- SString strHTTPDownloadURLFull ( " %s/%s/%s" , g_pClientGame->m_strHTTPDownloadURL .c_str (), pResource->GetName (), pDownloadableResource->GetShortName () );
4937
-
4938
- // Queue the file to be downloaded
4939
- pResource->AddPendingFileDownload ( strHTTPDownloadURLFull, pDownloadableResource->GetName (), dChunkDataSize );
4940
- }
4941
- }
4935
+ // Queue the file to be downloaded
4936
+ pResource->AddPendingFileDownload ( strHTTPDownloadURLFull, pDownloadableResource->GetName (), dChunkDataSize );
4937
+ }
4942
4938
}
4943
4939
}
4944
4940
0 commit comments