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

Function ParseFile_CdnBuild

src/External/CascLib/src/CascFiles.cpp:837–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

835}
836
837static DWORD ParseFile_CdnBuild(TCascStorage * hs, void * pvListFile)
838{
839 const char * szLineBegin;
840 const char * szLineEnd = NULL;
841 DWORD dwErrCode;
842
843 // Initialize the empty VFS array
844 dwErrCode = hs->VfsRootList.Create<CASC_CKEY_ENTRY>(0x10);
845 if(dwErrCode != ERROR_SUCCESS)
846 return dwErrCode;
847
848 // Parse all variables
849 while(ListFile_GetNextLine(pvListFile, &szLineBegin, &szLineEnd) != 0)
850 {
851 // Product name and build name
852 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "build-uid", LoadBuildProductId, NULL))
853 continue;
854 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "build-name", LoadBuildNumber, NULL))
855 continue;
856
857 // Content key of the ROOT file. Look this up in ENCODING to get the encoded key
858 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "root*", LoadCKeyEntry, &hs->RootFile))
859 continue;
860
861 // Content key [+ encoded key] of the INSTALL file
862 // If EKey is absent, you need to query the ENCODING file for it
863 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "install*", LoadCKeyEntry, &hs->InstallCKey))
864 continue;
865
866 // Content key [+ encoded key] of the DOWNLOAD file
867 // If EKey is absent, you need to query the ENCODING file for it
868 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "download*", LoadCKeyEntry, &hs->DownloadCKey))
869 continue;
870
871 // Content key + encoded key of the ENCODING file. Contains CKey+EKey
872 // If either none or 1 is found, the game (at least Wow) switches to plain-data(?). Seen in build 20173
873 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "encoding*", LoadCKeyEntry, &hs->EncodingCKey))
874 continue;
875
876 // PATCH file
877 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "patch*", LoadEKeyEntry, &hs->PatchFile))
878 continue;
879
880 // SIZE file
881 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "size*", LoadCKeyEntry, &hs->SizeFile))
882 continue;
883
884 // VFS root file (the root file of the storage VFS)
885 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "vfs-root*", LoadCKeyEntry, &hs->VfsRoot))
886 continue;
887
888 // Load a directory entry to the VFS
889 if(CheckConfigFileVariable(hs, szLineBegin, szLineEnd, "vfs-*", LoadVfsRootEntry, &hs->VfsRootList))
890 continue;
891 }
892
893 // Special case: Some builds of WoW (22267) don't have the variable in the build file
894 if(hs->szCodeName == NULL && hs->szCdnPath != NULL)

Callers

nothing calls this directly

Calls 4

ListFile_GetNextLineFunction · 0.85
CheckConfigFileVariableFunction · 0.85
CascNewStrFunction · 0.85
GetPlainFileNameFunction · 0.85

Tested by

no test coverage detected