@@ -16,8 +16,8 @@ class WiiLink_Patcher
16
16
//// Build Info ////
17
17
static readonly string version = "v2.0.4" ;
18
18
static readonly string copyrightYear = DateTime . Now . Year . ToString ( ) ;
19
- static readonly string buildDate = "October 11th , 2024" ;
20
- static readonly string buildTime = "3:24 PM" ;
19
+ static readonly string buildDate = "November 25th , 2024" ;
20
+ static readonly string buildTime = "4:45 PM" ;
21
21
static string ? sdcard = DetectRemovableDrive ;
22
22
static readonly string wiiLinkPatcherUrl = "https://patcher.wiilink24.com" ;
23
23
////////////////////
@@ -61,7 +61,7 @@ enum Platform : int { Wii, vWii, Dolphin }
61
61
static int console_height = 0 ;
62
62
63
63
// HttpClient
64
- static readonly HttpClient httpClient = new ( ) { Timeout = TimeSpan . FromSeconds ( 30 ) } ;
64
+ static readonly HttpClient httpClient = new ( ) { Timeout = TimeSpan . FromMinutes ( 1 ) } ;
65
65
////////////////////
66
66
67
67
static void PrintHeader ( )
@@ -364,10 +364,12 @@ static public void DownloadOSCApp(string appName)
364
364
/// </summary>
365
365
static public void DownloadAGC ( )
366
366
{
367
- if ( platformType != Platform . Dolphin ) {
367
+ if ( platformType != Platform . Dolphin )
368
+ {
368
369
DownloadOSCApp ( "AnyGlobe_Changer" ) ;
369
370
}
370
- else if ( ! Directory . Exists ( "./apps/AnyGlobe Changer" ) ) {
371
+ else if ( ! Directory . Exists ( "./apps/AnyGlobe Changer" ) )
372
+ {
371
373
task = $ "Downloading AnyGlobe_Changer";
372
374
string appPath = Path . Join ( tempDir , "AGC" ) ;
373
375
Directory . CreateDirectory ( appPath ) ;
@@ -388,6 +390,7 @@ static void DownloadFile(string URL, string dest, string name, bool noError = fa
388
390
{
389
391
task = $ "Downloading { name } ";
390
392
curCmd = $ "DownloadFile({ URL } , { dest } , { name } )";
393
+
391
394
if ( DEBUG_MODE )
392
395
AnsiConsole . MarkupLine ( $ "[springgreen2_1]Downloading [bold]{ name } [/] from [bold]{ URL } [/] to [bold]{ dest } [/][/]...") ;
393
396
@@ -409,19 +412,25 @@ static void DownloadFile(string URL, string dest, string name, bool noError = fa
409
412
ErrorScreen ( statusCode , $ "Failed to download [bold]{ name } [/] from [bold]{ URL } [/] to [bold]{ dest } [/]") ;
410
413
}
411
414
}
412
- catch ( Exception e )
415
+ // Timeout exception
416
+ catch ( TaskCanceledException )
417
+ {
418
+ if ( ! noError )
419
+ {
420
+ AnsiConsole . MarkupLine ( $ "[bold red]ERROR:[/] Failed to download [bold]{ name } [/] from [bold]{ URL } [/] to [bold]{ dest } [/]: Request timed out (1 minute)") ;
421
+ AnsiConsole . MarkupLine ( "Press any key to try again..." ) ;
422
+ Console . ReadKey ( true ) ;
423
+ DownloadFile ( URL , dest , name ) ;
424
+ }
425
+ }
426
+ catch ( HttpRequestException e )
413
427
{
414
428
if ( ! noError )
415
429
{
416
430
AnsiConsole . MarkupLine ( $ "[bold red]ERROR:[/] { e . Message } ") ;
417
- // If the exception is a WebException, display the status code of the response.
418
- if ( e is WebException we && we . Response is HttpWebResponse response )
419
- {
420
- int statusCode = ( int ) response . StatusCode ;
421
- AnsiConsole . MarkupLine ( $ "Status code: { statusCode } ") ;
422
- }
423
431
AnsiConsole . MarkupLine ( "Press any key to try again..." ) ;
424
432
Console . ReadKey ( true ) ;
433
+ DownloadFile ( URL , dest , name ) ;
425
434
}
426
435
}
427
436
}
@@ -1234,8 +1243,8 @@ static void ChoosePlatform()
1234
1243
break ;
1235
1244
case 3 :
1236
1245
platformType = Platform . Dolphin ;
1237
- sdcard = null ;
1238
- WADFolderCheck ( false ) ;
1246
+ sdcard = null ;
1247
+ WADFolderCheck ( false ) ;
1239
1248
break ;
1240
1249
case 4 : // Go back to main menu
1241
1250
MainMenu ( ) ;
@@ -2091,12 +2100,14 @@ static void DownloadAllPatches()
2091
2100
DownloadPatch ( "ktv" , $ "ktv_2.delta", "KirbyTV_2.delta" , "Kirby TV Channel" ) ;
2092
2101
}
2093
2102
2094
- if ( platformType != Platform . Dolphin ) {
2103
+ if ( platformType != Platform . Dolphin )
2104
+ {
2095
2105
// Download yawmME from OSC for installing WADs on the Wii
2096
2106
DownloadOSCApp ( "yawmME" ) ;
2097
2107
}
2098
2108
2099
- if ( platformType == Platform . Wii ) {
2109
+ if ( platformType == Platform . Wii )
2110
+ {
2100
2111
// Download sntp from OSC for Syncing the Clock on the Wii
2101
2112
DownloadOSCApp ( "sntp" ) ;
2102
2113
}
@@ -2123,7 +2134,8 @@ static void DownloadAllPatches()
2123
2134
DownloadPatch ( "cmoc" , $ "CMOC_1_{ wc24_reg } .delta", $ "CMOC_1_{ wc24_reg } .delta", "Check Mii Out Channel" ) ;
2124
2135
2125
2136
// Download ww-43db-patcher for vWii if applicable
2126
- if ( platformType == Platform . vWii ) {
2137
+ if ( platformType == Platform . vWii )
2138
+ {
2127
2139
// DownloadOSCApp("ww-43db-patcher");
2128
2140
2129
2141
// Also download EULA for each region for vWii users
@@ -2139,8 +2151,9 @@ static void DownloadAllPatches()
2139
2151
2140
2152
}
2141
2153
2142
- if ( platformType != Platform . Dolphin ) {
2143
- // Install the RC24 Mail Patcher
2154
+ if ( platformType != Platform . Dolphin )
2155
+ {
2156
+ // Install the RC24 Mail Patcher
2144
2157
DownloadOSCApp ( "Mail-Patcher" ) ;
2145
2158
}
2146
2159
@@ -2568,11 +2581,11 @@ static void CustomInstall_SummaryScreen(bool showSPD = false)
2568
2581
grid . AddRow ( $ "[bold deepskyblue1]{ wiiConnect24Channels } [/]", $ "[bold springgreen2_1]{ regionalChannels } [/]", $ "[bold]{ consoleVersion } [/]") ;
2569
2582
2570
2583
if ( platformType_custom == Platform . Wii )
2571
- grid . AddRow ( string . Join ( "\n " , selectedWiiConnect24Channels ) , string . Join ( "\n " , selectedRegionalChannels ) , "● [bold]Wii[/]" ) ;
2584
+ grid . AddRow ( string . Join ( "\n " , selectedWiiConnect24Channels ) , string . Join ( "\n " , selectedRegionalChannels ) , "● [bold]Wii[/]" ) ;
2572
2585
else if ( platformType_custom == Platform . vWii )
2573
- grid . AddRow ( string . Join ( "\n " , selectedWiiConnect24Channels ) , string . Join ( "\n " , selectedRegionalChannels ) , "● [bold]vWii (Wii U)[/]" ) ;
2586
+ grid . AddRow ( string . Join ( "\n " , selectedWiiConnect24Channels ) , string . Join ( "\n " , selectedRegionalChannels ) , "● [bold]vWii (Wii U)[/]" ) ;
2574
2587
else
2575
- grid . AddRow ( string . Join ( "\n " , selectedWiiConnect24Channels ) , string . Join ( "\n " , selectedRegionalChannels ) , "● [bold]Dolphin Emulator[/]" ) ;
2588
+ grid . AddRow ( string . Join ( "\n " , selectedWiiConnect24Channels ) , string . Join ( "\n " , selectedRegionalChannels ) , "● [bold]Dolphin Emulator[/]" ) ;
2576
2589
2577
2590
AnsiConsole . Write ( grid ) ;
2578
2591
@@ -2623,11 +2636,13 @@ static void CustomInstall_SummaryScreen(bool showSPD = false)
2623
2636
switch ( choice )
2624
2637
{
2625
2638
case 1 : // Yes
2626
- if ( platformType_custom != Platform . Dolphin ) {
2639
+ if ( platformType_custom != Platform . Dolphin )
2640
+ {
2627
2641
SDSetup ( isCustomSetup : true ) ;
2628
2642
break ;
2629
2643
}
2630
- else {
2644
+ else
2645
+ {
2631
2646
sdcard = null ;
2632
2647
WADFolderCheck ( true ) ;
2633
2648
break ;
@@ -2838,15 +2853,16 @@ static void DownloadCustomPatches(List<string> channelSelection)
2838
2853
}
2839
2854
}
2840
2855
2841
- if ( platformType_custom != Platform . Dolphin ) {
2842
- // Downloading yawmME from OSC
2856
+ if ( platformType_custom != Platform . Dolphin )
2857
+ {
2858
+ // Downloading yawmME from OSC
2843
2859
DownloadOSCApp ( "yawmME" ) ;
2844
- // Install the RC24 Mail Patcher
2860
+ // Install the RC24 Mail Patcher
2845
2861
DownloadOSCApp ( "Mail-Patcher" ) ;
2846
2862
}
2847
2863
2848
2864
if ( platformType_custom == Platform . Wii )
2849
- // Downloading sntp from OSC
2865
+ // Downloading sntp from OSC
2850
2866
DownloadOSCApp ( "sntp" ) ;
2851
2867
}
2852
2868
@@ -3217,7 +3233,8 @@ static void Finished()
3217
3233
}
3218
3234
else
3219
3235
{
3220
- if ( platformType != Platform . Dolphin ) {
3236
+ if ( platformType != Platform . Dolphin )
3237
+ {
3221
3238
// Please connect text
3222
3239
string connectDrive = patcherLang == PatcherLanguage . en
3223
3240
? "Please connect your Wii SD Card / USB Drive and copy the [u]WAD[/] and [u]apps[/] folders to the root (main folder) of your SD Card / USB Drive."
@@ -3234,19 +3251,22 @@ static void Finished()
3234
3251
}
3235
3252
3236
3253
// Please proceed text
3237
- if ( platformType == Platform . Wii ) {
3254
+ if ( platformType == Platform . Wii )
3255
+ {
3238
3256
string pleaseProceed = patcherLang == PatcherLanguage . en
3239
3257
? "Please proceed with the tutorial that you can find on [bold springgreen2_1 link]https://www.wiilink24.com/guide/wii/#section-ii---installing-wads-and-patching-wii-mail[/]"
3240
3258
: $ "{ localizedText ? [ "Finished" ] ? [ "pleaseProceed" ] } ";
3241
3259
AnsiConsole . MarkupLine ( $ "{ pleaseProceed } \n ") ;
3242
3260
}
3243
- else if ( platformType == Platform . vWii ) {
3261
+ else if ( platformType == Platform . vWii )
3262
+ {
3244
3263
string pleaseProceed = patcherLang == PatcherLanguage . en
3245
3264
? "Please proceed with the tutorial that you can find on [bold springgreen2_1 link]https://www.wiilink24.com/guide/vwii/#section-iii---installing-wads-and-patching-wii-mail[/]"
3246
3265
: $ "{ localizedText ? [ "Finished" ] ? [ "pleaseProceed" ] } ";
3247
3266
AnsiConsole . MarkupLine ( $ "{ pleaseProceed } \n ") ;
3248
3267
}
3249
- else {
3268
+ else
3269
+ {
3250
3270
string pleaseProceed = patcherLang == PatcherLanguage . en
3251
3271
? "Please proceed with the tutorial that you can find on [bold springgreen2_1 link]https://www.wiilink24.com/guide/dolphin/#section-ii---installing-wads[/]"
3252
3272
: $ "{ localizedText ? [ "Finished" ] ? [ "pleaseProceed" ] } ";
0 commit comments