Skip to content

Commit

Permalink
Replacing specific urls within the engine, with global defines for ea… (
Browse files Browse the repository at this point in the history
#147)

* Replacing specific urls within the engine, with global defines for easier access instead of changing the code every fucken time.

* fixed proper spacing for style check

* .. im ashamed i forgot the version.h file include @.@ ffs im so dumb.
  • Loading branch information
Bioblaze authored Nov 21, 2024
1 parent 1920b8e commit 54849aa
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
2 changes: 2 additions & 0 deletions core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ def version_info_builder(target, source, env):
#define EXTERNAL_VERSION_MINOR {external_minor}
#define EXTERNAL_VERSION_PATCH {external_patch}
#define EXTERNAL_VERSION_STATUS "{external_status}"
#define MIRROR_LIST_URL "{mirror_list}"
#define VERSION_URL "{version_url}"
""".format(**env.version_info)
)

Expand Down
4 changes: 3 additions & 1 deletion editor/engine_update_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

#include "core/io/json.h"
#include "core/os/time.h"
#include "core/version.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/themes/editor_scale.h"
Expand All @@ -47,7 +48,8 @@ bool EngineUpdateLabel::_can_check_updates() const {
void EngineUpdateLabel::_check_update() {
checked_update = true;
_set_status(UpdateStatus::BUSY);
http->request("https://godotengine.org/versions.json");
String version_url = VERSION_URL;
http->request(version_url);
}

void EngineUpdateLabel::_http_request_completed(int p_result, int p_response_code, const PackedStringArray &p_headers, const PackedByteArray &p_body) {
Expand Down
3 changes: 2 additions & 1 deletion editor/export/export_template_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ void ExportTemplateManager::_refresh_mirrors() {
is_refreshing_mirrors = true;

String current_version = EXTERNAL_VERSION_FULL_CONFIG;
const String mirrors_metadata_url = "https://blazium.app/mirrorlist/" + current_version + ".json";
String mirror_list_url = MIRROR_LIST_URL;
const String mirrors_metadata_url = mirror_list_url + current_version + ".json";
request_mirrors->request(mirrors_metadata_url);
}

Expand Down
2 changes: 2 additions & 0 deletions methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ def get_version_info(module_version_string="", silent=False):
"external_patch": int(os.getenv("EXTERNAL_PATCH", version.external_patch)),
"external_status": os.getenv("EXTERNAL_STATUS", version.external_status),
"external_sha": os.getenv("EXTERNAL_SHA", version.external_status),
"mirror_list": os.getenv("MIRROR_LIST_URL", version.mirror_list),
"version_url": os.getenv("VERSION_URL", version.version_url),
}

# For dev snapshots (alpha, beta, RC, etc.) we do not commit status change to Git,
Expand Down
2 changes: 2 additions & 0 deletions version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@
external_patch = 0
external_status = "nightly"
external_sha = "ff9bc0422349219b337b015643544a0454d4a7ee"
mirror_list = "https://blazium.app/mirrorlist/"
version_url = "https://blazium.app/versions-" + external_status + ".json"

0 comments on commit 54849aa

Please sign in to comment.