diff options
Diffstat (limited to 'dep/CascLib/src/CascFiles.cpp')
-rw-r--r-- | dep/CascLib/src/CascFiles.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/dep/CascLib/src/CascFiles.cpp b/dep/CascLib/src/CascFiles.cpp index 8d90df23000..f47b8316693 100644 --- a/dep/CascLib/src/CascFiles.cpp +++ b/dep/CascLib/src/CascFiles.cpp @@ -503,7 +503,20 @@ static void SetProductCodeName(TCascStorage * hs, LPCSTR szCodeName) } } -static int GetDefaultLocaleMask(TCascStorage * hs, const CASC_CSV_COLUMN & Column) +static DWORD GetDefaultCdnPath(TCascStorage * hs, const CASC_CSV_COLUMN & Column) +{ + TCHAR szCdnPath[MAX_PATH]; + + if(hs->szCdnPath == NULL && Column.nLength != 0) + { + CascStrCopy(szCdnPath, _countof(szCdnPath), Column.szValue); + hs->szCdnPath = CascNewStr(szCdnPath); + } + + return ERROR_SUCCESS; +} + +static DWORD GetDefaultLocaleMask(TCascStorage * hs, const CASC_CSV_COLUMN & Column) { LPCSTR szTagEnd = Column.szValue + Column.nLength - 4; LPCSTR szTagPtr = Column.szValue; @@ -662,6 +675,9 @@ static DWORD ParseFile_BuildInfo(TCascStorage * hs, CASC_CSV & Csv) if (dwErrCode != ERROR_SUCCESS) return dwErrCode; + // Get the CDN path + GetDefaultCdnPath(hs, Csv[nSelected]["CDN Path!STRING:0"]); + // If we found tags, we can extract language build from it GetDefaultLocaleMask(hs, Csv[nSelected]["Tags!STRING:0"]); @@ -1228,7 +1244,9 @@ DWORD GetFileSpanInfo(PCASC_CKEY_ENTRY pCKeyEntry, PULONGLONG PtrContentSize, PU // Sanity check assert(pCKeyEntry->SpanCount != 0); - // Sum all span size + // Sum the file size over all file spans + // Note: The first file span, if referenced by the ROOT folder, gets the same size + // like the entire file (example: zone\base.xpak, zone\base.xpak_1) for(DWORD i = 0; i < dwSpanCount; i++, pCKeyEntry++) { if(pCKeyEntry->ContentSize == CASC_INVALID_SIZE) @@ -1433,7 +1451,7 @@ LPBYTE LoadInternalFileToMemory(TCascStorage * hs, PCASC_CKEY_ENTRY pCKeyEntry, cbFileData = pCKeyEntry->ContentSize; } - // Retrieve the size of the ENCODING file + // Load the entire file to memory if(dwErrCode == ERROR_SUCCESS) { // Allocate space for the ENCODING file |