diff options
author | Shauren <shauren.trinity@gmail.com> | 2019-10-29 19:01:39 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-10-29 19:01:39 +0100 |
commit | c7b41574376c21eb37ed6d45dc4f1b3bf1b528c4 (patch) | |
tree | d14503fb201a38ea913627a7b00a8fd395e3a2a9 /dep/CascLib/src/CascFiles.cpp | |
parent | 4328e1dfb2ba0900e6a053622f16da1cd5debc9b (diff) |
Dep/CascLib: Update to ladislav-zezula/CascLib@225777494069b0b0e18bea3ffeb3773d44a70b30
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 |