Skip to content

Commit

Permalink
Use GitHub as primary server
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Mod-Manager/src/Environment3/RushInterface.cs
  • Loading branch information
HyperPolygon64 committed Mar 22, 2020
1 parent bbd892f commit f5356e2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sonic-06-Mod-Manager/src/Environment3/RushInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private void LoadSettings()

if (CheckBox_CheckUpdatesOnLaunch.Checked = Properties.Settings.Default.General_CheckUpdatesOnLaunch) {
Properties.Settings.Default.General_LastSoftwareUpdate = DateTime.Now.Ticks;
CheckForUpdates(Properties.Resources.VersionURI_SEGACarnival, Properties.Resources.ChangelogsURI_SEGACarnival);
CheckForUpdates(Properties.Resources.VersionURI_GitHub, Properties.Resources.ChangelogsURI_GitHub);
}

if (CheckBox_SaveFileRedirection.Checked = Properties.Settings.Default.General_SaveFileRedirection) {
Expand Down Expand Up @@ -467,8 +467,8 @@ private async void CheckForUpdates(string versionURI, string changelogsURI) {
throw new WebException();
} catch {
try {
// Check for updates via GitHub
CheckForUpdates(Properties.Resources.VersionURI_GitHub, Properties.Resources.ChangelogsURI_GitHub);
// Check for updates via SEGA Carnival
CheckForUpdates(Properties.Resources.VersionURI_SEGACarnival, Properties.Resources.ChangelogsURI_SEGACarnival);
Properties.Settings.Default.General_LastSoftwareUpdate = DateTime.Now.Ticks;
_useBackupServer = true;
} catch (Exception ex) {
Expand Down Expand Up @@ -1430,8 +1430,8 @@ private void UpdateVersion(bool useBackupServer) {

try {
// If SEGA Carnival is offline, use GitHub
Uri serverUri = new Uri(Properties.Resources.DataURI_SEGACarnival);
if (useBackupServer) serverUri = new Uri(Properties.Resources.DataURI_GitHub);
Uri serverUri = new Uri(Properties.Resources.DataURI_GitHub);
if (useBackupServer) serverUri = new Uri(Properties.Resources.DataURI_SEGACarnival);

using (WebClient client = new WebClient()) {
client.DownloadProgressChanged += (s, clientEventArgs) => { ProgressBar_SoftwareUpdate.Value = clientEventArgs.ProgressPercentage; };
Expand Down Expand Up @@ -1519,8 +1519,8 @@ private void ListView_ModUpdates_ItemChecked(object sender, ItemCheckedEventArgs
private async void SectionButton_Updates_Click(object sender, EventArgs e) {
// Check for software updates is clicked
if (sender == SectionButton_CheckForSoftwareUpdates) {
// Check for updates via SEGA Carnival
CheckForUpdates(Properties.Resources.VersionURI_SEGACarnival, Properties.Resources.ChangelogsURI_SEGACarnival);
// Check for updates via GitHub
CheckForUpdates(Properties.Resources.VersionURI_GitHub, Properties.Resources.ChangelogsURI_GitHub);
Properties.Settings.Default.General_LastSoftwareUpdate = DateTime.Now.Ticks;
if (((SectionButton)sender).SectionText == "Fetch the latest version") UpdateVersion(_useBackupServer); // Update if prompted
Properties.Settings.Default.Save();
Expand Down

0 comments on commit f5356e2

Please sign in to comment.