Skip to content

Commit

Permalink
Switch download URLs to classicube CDN
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed May 2, 2024
1 parent 77e890a commit 5a4b00c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'bin/Release'
DEST_NAME: 'MCGalaxy-infid'
DEST_NAME: 'MCGalaxy-infid'

- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'CLI/bin/Debug/net6.0/osx-x64/publish'
DEST_NAME: 'MCGalaxy-mac64-standalone'
DEST_NAME: 'MCGalaxy-mac64-standalone'


- uses: ./.github/actions/notify_success
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
id: compile
shell: bash
run: |
make_dotnet_zip() {
cp sqlite3_x32.dll $1/sqlite3_x32.dll
cp sqlite3_x64.dll $1/sqlite3_x64.dll
Expand Down
2 changes: 1 addition & 1 deletion MCGalaxy/Database/Backends/SQLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override ISqlConnection CreateConnection() {


public override void LoadDependencies() {
// on macOS/Linux, use the system provided sqlite3 native library
// on macOS/Linux, system provided sqlite3 native library is used
if (!IOperatingSystem.DetectOS().IsWindows) return;

Server.CheckFile("sqlite3_x32.dll");
Expand Down
29 changes: 18 additions & 11 deletions MCGalaxy/Server/Maintenance/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,26 @@ public static class Updater
{
public static string SourceURL = "https://github.com/ClassiCube/MCGalaxy";
public const string BaseURL = "https://raw.githubusercontent.com/ClassiCube/MCGalaxy/master/";
public const string UploadsURL = "https://github.com/ClassiCube/MCGalaxy/tree/master/Uploads";

public const string UploadsURL = "https://github.com/ClassiCube/MCGalaxy/tree/master/Uploads";
const string CurrentVersionURL = BaseURL + "Uploads/current_version.txt";
const string changelogURL = BaseURL + "Changelog.txt";

const string CRN_URL = "https://cs.classicube.net/c_client/mcg/release/";
#if NET_20
const string CDN_BASE = CRN_URL + "net20/";
#else
const string CDN_BASE = CRN_URL + "net40/";
#endif

#if MCG_STANDALONE
static string dllURL = "https://cs.classicube.net/mcgalaxy/" + IOperatingSystem.DetectOS().StandaloneName;
static string DLL_URL = CRN_URL + IOperatingSystem.DetectOS().StandaloneName;
#elif TEN_BIT_BLOCKS
const string dllURL = BaseURL + "Uploads/MCGalaxy_infid.dll";
const string DLL_URL = CDN_BASE + "MCGalaxy_infid.dll";
#else
const string dllURL = BaseURL + "Uploads/MCGalaxy_.dll";
const string DLL_URL = CDN_BASE + "MCGalaxy_.dll";
#endif
const string changelogURL = BaseURL + "Changelog.txt";
const string guiURL = BaseURL + "Uploads/MCGalaxy.exe";
const string cliURL = BaseURL + "Uploads/MCGalaxyCLI.exe";
const string GUI_URL = CDN_BASE + "MCGalaxy.exe";
const string CLI_URL = CDN_BASE + "MCGalaxyCLI.exe";

public static event EventHandler NewerVersionDetected;

Expand Down Expand Up @@ -79,10 +86,10 @@ public static void PerformUpdate() {
}

WebClient client = HttpUtil.CreateWebClient();
client.DownloadFile(dllURL, "MCGalaxy_.update");
client.DownloadFile(DLL_URL, "MCGalaxy_.update");
#if !MCG_STANDALONE
client.DownloadFile(guiURL, "MCGalaxy.update");
client.DownloadFile(cliURL, "MCGalaxyCLI.update");
client.DownloadFile(GUI_URL, "MCGalaxy.update");
client.DownloadFile(CLI_URL, "MCGalaxyCLI.update");
#endif
client.DownloadFile(changelogURL, "Changelog.txt");

Expand Down
2 changes: 1 addition & 1 deletion MCGalaxy/util/OperatingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected virtual void RestartInPlace() {
class LinuxOS : UnixOS
{
public override string StandaloneName {
get { return IntPtr.Size == 8 ? "nix64" : "nix32"; }
get { return IntPtr.Size == 8 ? "linux64" : "linux32"; }
}

public override void Init() {
Expand Down

0 comments on commit 5a4b00c

Please sign in to comment.