MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / CheckUpdates

Method CheckUpdates

Sources/Main.cpp:1959–1978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1957}
1958
1959void GameEventHandler::CheckUpdates()
1960{
1961#if !defined(DEATH_DEBUG)
1962 ZoneScopedC(0x888888);
1963
1964 String url = "https://deat.tk/downloads/games/jazz2/updates?v=" NCINE_VERSION "&d=" + PreferencesCache::GetDeviceID();
1965 auto request = WebSession::GetDefault().CreateRequest(url);
1966 auto result = request.Execute();
1967 if (result) {
1968 auto s = request.GetResponse().AsString();
1969 constexpr std::uint64_t currentVersion = parseVersion(NCINE_VERSION_s);
1970 std::uint64_t latestVersion = parseVersion(s);
1971 if (currentVersion < latestVersion) {
1972 _newestVersion = s;
1973 }
1974 } else {
1975 LOGW("Failed to check for updates: {}", result.error);
1976 }
1977#endif
1978}
1979#endif
1980
1981bool GameEventHandler::SetLevelHandler(const LevelInitialization& levelInit)

Callers 1

OnInitializeMethod · 0.80

Calls 5

parseVersionFunction · 0.85
CreateRequestMethod · 0.80
ExecuteMethod · 0.80
AsStringMethod · 0.80
GetResponseMethod · 0.45

Tested by

no test coverage detected