void GetWar3Ver() { TCHAR tcTmp[MAX_PATH]; GetModuleFileName((HMODULE)GameBase,tcTmp,MAX_PATH); TCHAR FileVer[64]; GetFileVer(tcTmp,FileVer,64); if(lstrcmpi(FileVer,TEXT("1, 24, 1, 6374")) == 0) { GameVersion = V124B; } else if(lstrcmpi(FileVer,TEXT("1, 24, 4, 6387")) == 0) { GameVersion = V124E; } else if(lstrcmpi(FileVer,TEXT("1, 26, 0, 6401")) ==0) { GameVersion = V126A; } else { GameVersion = 0; } }
void CStatistic::ReplacePlaceholders( CString & szUrl, const CString & szType, const CString & szAction ) { if (szUrl.IsEmpty()) { ATLASSERT(FALSE); return; } if (m_szPID.IsEmpty()) { m_szPID = GetPID(); } if (m_szMID.IsEmpty()) { GetMID(m_szMID.GetBufferSetLength(MAX_PATH), MAX_PATH); } if (m_szAppVer.IsEmpty()) { WCHAR szFile[MAX_PATH] = {}; GetModuleFileName(g_hModule, szFile, MAX_PATH); PathRemoveFileSpec(szFile); PathRemoveFileSpec(szFile); PathAppend(szFile, APP_NAME); GetFileVer(szFile, m_szAppVer.GetBufferSetLength(MAX_PATH), MAX_PATH); } if (m_szModVer.IsEmpty()) { WCHAR szFile[MAX_PATH] = {}; GetModuleFileName(g_hModule, szFile, MAX_PATH); GetFileVer(szFile, m_szModVer.GetBufferSetLength(MAX_PATH), MAX_PATH); } if (szUrl.Find(URL_PID) > 0) { szUrl.Replace(URL_PID, m_szPID); } if (szUrl.Find(URL_MID) > 0) { szUrl.Replace(URL_MID, m_szMID); } if (szUrl.Find(URL_APP_VER) > 0) { szUrl.Replace(URL_APP_VER, m_szAppVer); } if (szUrl.Find(URL_MOD_VER) > 0) { szUrl.Replace(URL_MOD_VER, m_szModVer); } if (szUrl.Find(URL_TYPE) > 0) { szUrl.Replace(URL_TYPE, szType); } if (szUrl.Find(URL_ACTION) > 0) { szUrl.Replace(URL_ACTION, szAction); } }