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

Function ParseRegionLine_Versions

src/External/CascLib/src/CascFiles.cpp:726–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

724}
725
726static DWORD ParseRegionLine_Versions(TCascStorage * hs, CASC_CSV & Csv, size_t nLine)
727{
728 DWORD dwErrCode;
729
730 // If the region line is not there yet, supply default one
731 if(hs->szRegion == NULL)
732 hs->szRegion = CascNewStr(Csv[nLine]["Region!STRING:0"].szValue);
733
734 // Get the default locale mask based on the region
735 hs->dwDefaultLocale = GetDefaultLocaleByRegion(hs->szRegion);
736
737 // Extract the CDN build key
738 dwErrCode = LoadQueryKey(Csv[nLine]["BuildConfig!HEX:16"], hs->CdnBuildKey);
739 if(dwErrCode != ERROR_SUCCESS)
740 return dwErrCode;
741
742 // Extract the CDN config key
743 dwErrCode = LoadQueryKey(Csv[nLine]["CDNConfig!HEX:16"], hs->CdnConfigKey);
744 if(dwErrCode != ERROR_SUCCESS)
745 return dwErrCode;
746
747 const CASC_CSV_COLUMN & VerColumn = Csv[nLine]["VersionsName!String:0"];
748 if(VerColumn.szValue && VerColumn.nLength)
749 {
750 LoadBuildNumber(hs, NULL, VerColumn.szValue, VerColumn.szValue + VerColumn.nLength, NULL);
751 }
752
753 // Verify all variables
754 if(hs->CdnBuildKey.pbData != NULL && hs->CdnConfigKey.pbData != NULL)
755 {
756 // If we have manually given build key, override the value
757 if(hs->szBuildKey != NULL)
758 dwErrCode = BinaryFromString(hs->szBuildKey, MD5_STRING_SIZE, hs->CdnBuildKey.pbData);
759 return dwErrCode;
760 }
761
762 return ERROR_BAD_FORMAT;
763}
764
765static DWORD ParseRegionLine_Cdns(TCascStorage * hs, CASC_CSV & Csv, size_t nLine)
766{

Callers

nothing calls this directly

Calls 5

CascNewStrFunction · 0.85
GetDefaultLocaleByRegionFunction · 0.85
LoadQueryKeyFunction · 0.85
LoadBuildNumberFunction · 0.85
BinaryFromStringFunction · 0.85

Tested by

no test coverage detected