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

Function LoadBuildNumber

src/External/CascLib/src/CascFiles.cpp:508–540  ·  view source on GitHub ↗

"B29049" "WOW-18125patch6.0.1" "WOW-45779patch10.0.2_Beta" "30013_Win32_2_2_0_Ptr_ptr" "prometheus-0_8_0_0-24919"

Source from the content-addressed store, hash-verified

506// "30013_Win32_2_2_0_Ptr_ptr"
507// "prometheus-0_8_0_0-24919"
508static DWORD LoadBuildNumber(TCascStorage * hs, const char * /* szVariableName */, const char * szDataBegin, const char * szDataEnd, void * /* pvParam */)
509{
510 DWORD dwBuildNumber = 0;
511 DWORD dwMaxValue = 0;
512
513 // Parse the string and take the largest decimal numeric value
514 // "build-name = 1.21.5.4037-retail"
515 while(szDataBegin < szDataEnd)
516 {
517 // If the character is a digit, we include it into the built number
518 if(IsCharDigit(szDataBegin[0]))
519 {
520 dwBuildNumber = (dwBuildNumber * 10) + (szDataBegin[0] - '0');
521 dwMaxValue = CASCLIB_MAX(dwBuildNumber, dwMaxValue);
522 }
523 else
524 {
525 // Reset build number when we find non-digit char
526 dwBuildNumber = 0;
527 }
528
529 // Move to the next
530 szDataBegin++;
531 }
532
533 // If we don't have a build number yet, take the max value, if any
534 if(hs->dwBuildNumber == 0 && dwMaxValue >= 100)
535 {
536 hs->dwBuildNumber = dwMaxValue;
537 return ERROR_SUCCESS;
538 }
539 return ERROR_BAD_FORMAT;
540}
541
542static int LoadQueryKey(const CASC_CSV_COLUMN & Column, CASC_BLOB & Key)
543{

Callers 2

ParseFile_BuildInfoFunction · 0.85
ParseRegionLine_VersionsFunction · 0.85

Calls 1

IsCharDigitFunction · 0.85

Tested by

no test coverage detected