| 1635 | } |
| 1636 | |
| 1637 | DWORD 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 | |
| 1670 | DWORD LoadMainFile(TCascStorage * hs) |
| 1671 | { |
no test coverage detected