Skip to content

Commit 298f655

Browse files
committed
Update MainScreen.cs
Add Webtimeout for "Fetching ModNetReloaded Files: " RemoteRPC split on Try/Catch for logging purposes/clarity
1 parent 374ffb4 commit 298f655

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

GameLauncher/App/MainScreen.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ private void MainScreen_Load(object sender, EventArgs e) {
495495
translatedBy.Text = "";
496496
ContextMenu = new ContextMenu();
497497

498-
ContextMenu.MenuItems.Add(new MenuItem("Donate", (b,n) => { Process.Start("http://paypal.me/metonator95"); }));
498+
ContextMenu.MenuItems.Add(new MenuItem("Donate", (b,n) => { Process.Start("https://paypal.me/metonator95"); }));
499499
ContextMenu.MenuItems.Add("-");
500500
ContextMenu.MenuItems.Add(new MenuItem("Settings", SettingsButton_Click));
501501
ContextMenu.MenuItems.Add(new MenuItem("Add Server", AddServer_Click));
@@ -2412,8 +2412,8 @@ private void PlayButton_Click(object sender, EventArgs e) {
24122412
foreach (string file in newFiles) {
24132413
playProgressText.Text = ("Fetching ModNetReloaded Files: " + file).ToUpper();
24142414
Application.DoEvents();
2415-
2416-
newModNetFilesDownload.DownloadFile("https://cdn.soapboxrace.world/modules-v2/" + file, _settingFile.Read("InstallationDirectory") + "/" + file);
2415+
newModNetFilesDownload.Timeout(8000);
2416+
newModNetFilesDownload.DownloadFile("http://cdn.soapboxrace.world/modules-v2/" + file, _settingFile.Read("InstallationDirectory") + "/" + file);
24172417
}
24182418

24192419
//get files now
@@ -2424,8 +2424,12 @@ private void PlayButton_Click(object sender, EventArgs e) {
24242424
try
24252425
{
24262426
//Cached content goes here
2427-
EventList.remoteEvent = new WebClientWithTimeout().DownloadString(json2.basePath + "/events.json");
2428-
CarList.remoteCarList = new WebClientWithTimeout().DownloadString(json2.basePath + "/cars.json");
2427+
EventList.remoteEvent = new WebClientWithTimeout().DownloadString(json2.BasePath + "/events.json");
2428+
}
2429+
catch { }
2430+
try
2431+
{
2432+
CarList.remoteCarList = new WebClientWithTimeout().DownloadString(json2.BasePath + "/cars.json");
24292433
}
24302434
catch { }
24312435

0 commit comments

Comments
 (0)