mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-04-11 08:41:38 +02:00
47 lines
1.6 KiB
Diff
47 lines
1.6 KiB
Diff
Disable the version check as the package is managed through apk
|
|
|
|
diff --git a/src/openrct2/Version.cpp b/src/openrct2/Version.cpp
|
|
index 0b1863e60..aae965b99 100644
|
|
--- a/src/openrct2/Version.cpp
|
|
+++ b/src/openrct2/Version.cpp
|
|
@@ -61,38 +61,5 @@ NewVersionInfo GetLatestVersion()
|
|
// with invalid data.
|
|
std::string tag = gVersionInfoTag;
|
|
NewVersionInfo verinfo{ tag, "", "", "" };
|
|
-#ifndef DISABLE_HTTP
|
|
- auto now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
|
|
- auto then = Config::Get().general.LastVersionCheckTime;
|
|
- if (then < now - 24 * 60 * 60)
|
|
- {
|
|
- Http::Request request;
|
|
- request.url = "https://api.github.com/repos/OpenRCT2/OpenRCT2/releases/latest";
|
|
- request.method = Http::Method::GET;
|
|
-
|
|
- Http::Response res;
|
|
- try
|
|
- {
|
|
- res = Do(request);
|
|
- if (res.status != Http::Status::Ok)
|
|
- throw std::runtime_error("bad http status");
|
|
- }
|
|
- catch (std::exception& e)
|
|
- {
|
|
- Console::Error::WriteLine("Failed to download '%s', cause %s", request.url.c_str(), e.what());
|
|
- return {};
|
|
- }
|
|
-
|
|
- json_t root = Json::FromString(res.body);
|
|
-
|
|
- verinfo.tag = Json::GetString(root["tag_name"]);
|
|
- verinfo.name = Json::GetString(root["name"]);
|
|
- verinfo.changelog = Json::GetString(root["body"]);
|
|
- verinfo.url = Json::GetString(root["html_url"]);
|
|
-
|
|
- Config::Get().general.LastVersionCheckTime = now;
|
|
- Config::Save();
|
|
- }
|
|
-#endif
|
|
return verinfo;
|
|
}
|
|
|