MCPcopy Create free account
hub / github.com/Scobalula/Greyhound / LoadBuildFile_Versions_Cdns

Function LoadBuildFile_Versions_Cdns

src/External/CascLib/src/CascFiles.cpp:1637–1668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1635}
1636
1637DWORD LoadBuildFile_Versions_Cdns(TCascStorage * hs)
1638{
1639 LPCTSTR szVersions = _T("versions");
1640 DWORD dwErrCode;
1641 TCHAR szBuffer[MAX_PATH];
1642 bool bForceDownload = (hs->dwFeatures & CASC_FEATURE_FORCE_DOWNLOAD) ? true : false;
1643
1644 // The default name of the build file is "versions". However, the caller may select different file
1645 if(hs->szMainFile && hs->szMainFile[0])
1646 szVersions = GetPlainFileName(hs->szMainFile);
1647 dwErrCode = LoadCsvFile(hs, ParseRegionLine_Versions, szVersions, "Region!STRING:0", bForceDownload);
1648
1649 // We also need to load the "cdns" file
1650 if(dwErrCode == ERROR_SUCCESS)
1651 {
1652 // The default CDNS file is "cdns". However, if the build file is different, we change "cdns" as well
1653 // Example: If the build file name is "hearthstone-25.0.3.160183.159202.versions", then we want "hearthstone-25.0.3.160183.159202.cdns"
1654 if(hs->szMainFile && hs->szMainFile[0])
1655 {
1656 if(ReplaceVersionsWithCdns(szBuffer, _countof(szBuffer), hs->szMainFile))
1657 {
1658 dwErrCode = LoadCsvFile(hs, ParseRegionLine_Cdns, szBuffer, "Name!STRING:0", bForceDownload);
1659 if(dwErrCode == ERROR_SUCCESS)
1660 return dwErrCode;
1661 }
1662 }
1663
1664 // Fall back to the default "cdns" file
1665 dwErrCode = LoadCsvFile(hs, ParseRegionLine_Cdns, _T("cdns"), "Name!STRING:0", bForceDownload);
1666 }
1667 return dwErrCode;
1668}
1669
1670DWORD LoadMainFile(TCascStorage * hs)
1671{

Callers 1

LoadMainFileFunction · 0.85

Calls 3

GetPlainFileNameFunction · 0.85
LoadCsvFileFunction · 0.85
ReplaceVersionsWithCdnsFunction · 0.85

Tested by

no test coverage detected