@@ -49,7 +49,6 @@ public partial class RushInterface : UserControl
4949 {
5050 private bool _isPathInvalid = false ;
5151 private static string protocol = "sonic06mm" ;
52- private bool _useBackupServer = false ;
5352
5453 public RushInterface ( ) {
5554 InitializeComponent ( ) ; // Designer support
@@ -238,7 +237,7 @@ private void LoadSettings()
238237
239238 if ( CheckBox_CheckUpdatesOnLaunch . Checked = Properties . Settings . Default . General_CheckUpdatesOnLaunch ) {
240239 Properties . Settings . Default . General_LastSoftwareUpdate = DateTime . Now . Ticks ;
241- CheckForUpdates ( Properties . Resources . VersionURI_GitHub , Properties . Resources . ChangelogsURI_GitHub ) ;
240+ CheckForUpdates ( ) ;
242241 }
243242
244243 if ( CheckBox_SaveFileRedirection . Checked = Properties . Settings . Default . General_SaveFileRedirection ) {
@@ -448,14 +447,14 @@ private void SectionButton_DeselectAll() {
448447 /// <summary>
449448 /// Pings the update servers to check for a new version.
450449 /// </summary>
451- private async void CheckForUpdates ( string versionURI , string changelogsURI ) {
450+ private async void CheckForUpdates ( ) {
452451 // Block controls
453452 SectionButton_CheckForSoftwareUpdates . Enabled = false ;
454453
455454 try {
456455 if ( Client . CheckNetworkConnection ( ) . Result ) {
457- string latestVersion = await Client . RequestString ( versionURI ) , // Request version number
458- changelogs = await Client . RequestString ( changelogsURI ) ; // Request changelogs
456+ string latestVersion = await Client . RequestString ( Properties . Resources . VersionURI_GitHub ) , // Request version number
457+ changelogs = await Client . RequestString ( Properties . Resources . ChangelogsURI_GitHub ) ; // Request changelogs
459458
460459 // New update available!
461460 if ( Program . VersionNumber != latestVersion && latestVersion . StartsWith ( "Version" ) )
@@ -469,27 +468,17 @@ private async void CheckForUpdates(string versionURI, string changelogsURI) {
469468 throw new WebException ( "Invalid version number - server might be down..." ) ;
470469 } else
471470 throw new WebException ( "Could not establish a connection..." ) ;
472- } catch {
473- try {
474- // Check for updates via SEGA Carnival
475- if ( Client . CheckNetworkConnection ( ) . Result ) {
476- CheckForUpdates ( Properties . Resources . VersionURI_SEGACarnival , Properties . Resources . ChangelogsURI_SEGACarnival ) ;
477- Properties . Settings . Default . General_LastSoftwareUpdate = DateTime . Now . Ticks ;
478- _useBackupServer = true ;
479- } else
480- throw new WebException ( "Could not establish a connection..." ) ;
481- } catch ( Exception ex ) {
482- Label_UpdaterStatus . Text = "Connection error" ;
483- PictureBox_UpdaterIcon . BackgroundImage = Properties . Resources . Exception_Logo ;
471+ } catch ( Exception ex ) {
472+ Label_UpdaterStatus . Text = "Connection error" ;
473+ PictureBox_UpdaterIcon . BackgroundImage = Properties . Resources . Exception_Logo ;
484474
485- // Reset update button for future checking
486- SectionButton_CheckForSoftwareUpdates . SectionText = "Check for software updates" ;
487- SectionButton_CheckForSoftwareUpdates . Refresh ( ) ;
475+ // Reset update button for future checking
476+ SectionButton_CheckForSoftwareUpdates . SectionText = "Check for software updates" ;
477+ SectionButton_CheckForSoftwareUpdates . Refresh ( ) ;
488478
489- // Write exception to logs
490- RichTextBox_Changelogs . Text = $ "Failed to request changelogs...\n \n { ex } ";
491- Console . WriteLine ( $ "[{ DateTime . Now : HH:mm:ss tt} ] [Error] Failed to request changelogs...\n { ex } ") ;
492- }
479+ // Write exception to logs
480+ RichTextBox_Changelogs . Text = $ "Failed to request changelogs...\n \n { ex } ";
481+ Console . WriteLine ( $ "[{ DateTime . Now : HH:mm:ss tt} ] [Error] Failed to request changelogs...\n { ex } ") ;
493482 }
494483
495484 // Feedback
@@ -1325,7 +1314,7 @@ private void LinkLabel_Reset_LinkClicked(object sender, LinkLabelLinkClickedEven
13251314 /// <summary>
13261315 /// Update Sonic '06 Mod Manager via requested server.
13271316 /// </summary>
1328- private void UpdateVersion ( bool useBackupServer ) {
1317+ private void UpdateVersion ( ) {
13291318 // Set controls enabled and visibility state
13301319 SectionButton_CheckForSoftwareUpdates . Visible = CheckBox_CheckUpdatesOnLaunch . Enabled = false ;
13311320 TabControl_Rush . SelectedTab . VerticalScroll . Value = 0 ;
@@ -1334,7 +1323,6 @@ private void UpdateVersion(bool useBackupServer) {
13341323 try {
13351324 // If SEGA Carnival is offline, use GitHub
13361325 Uri serverUri = new Uri ( Properties . Resources . DataURI_GitHub ) ;
1337- if ( useBackupServer ) serverUri = new Uri ( Properties . Resources . DataURI_SEGACarnival ) ;
13381326
13391327 using ( WebClient client = new WebClient ( ) ) {
13401328 client . DownloadProgressChanged += ( s , clientEventArgs ) => { ProgressBar_SoftwareUpdate . Value = clientEventArgs . ProgressPercentage ; } ;
@@ -1431,9 +1419,9 @@ private async void SectionButton_Updates_Click(object sender, EventArgs e) {
14311419 // Check for software updates is clicked
14321420 if ( sender == SectionButton_CheckForSoftwareUpdates ) {
14331421 // Check for updates via GitHub
1434- CheckForUpdates ( Properties . Resources . VersionURI_GitHub , Properties . Resources . ChangelogsURI_GitHub ) ;
1422+ CheckForUpdates ( ) ;
14351423 Properties . Settings . Default . General_LastSoftwareUpdate = DateTime . Now . Ticks ;
1436- if ( ( ( SectionButton ) sender ) . SectionText == "Fetch the latest version" ) UpdateVersion ( _useBackupServer ) ; // Update if prompted
1424+ if ( ( ( SectionButton ) sender ) . SectionText == "Fetch the latest version" ) UpdateVersion ( ) ; // Update if prompted
14371425 Properties . Settings . Default . Save ( ) ;
14381426
14391427 // Check for mod updates is clicked
@@ -1645,7 +1633,7 @@ private void LinkLabel_1ClickURLHandler_LinkClicked(object sender, LinkLabelLink
16451633 sonic06mmKey = Registry . CurrentUser . OpenSubKey ( $ "Software\\ Classes\\ { protocol } ", true ) ;
16461634 if ( sonic06mmKey == null )
16471635 sonic06mmKey = Registry . CurrentUser . CreateSubKey ( $ "Software\\ Classes\\ { protocol } ") ;
1648- sonic06mmKey . SetValue ( string . Empty , "URL: Sonic '06 Mod Manager" ) ;
1636+ sonic06mmKey . SetValue ( string . Empty , "Sonic '06 Mod Manager" ) ;
16491637 sonic06mmKey . SetValue ( "URL Protocol" , string . Empty ) ;
16501638 RegistryKey prevkey = sonic06mmKey ;
16511639 sonic06mmKey = sonic06mmKey . OpenSubKey ( "shell" , true ) ;
0 commit comments