Remove redundant connectivity check

keep the single connectivity check for testing if the roblox website can be contacted
This commit is contained in:
pizzaboxer 2023-08-02 14:59:29 +01:00
parent 173494641a
commit ba57d584f0
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
2 changed files with 29 additions and 46 deletions

View File

@ -149,33 +149,6 @@ namespace Bloxstrap
}
}
if (!IsMenuLaunch)
{
Logger.WriteLine(LOG_IDENT, "Performing connectivity check...");
try
{
HttpClient.GetAsync("https://detectportal.firefox.com").Wait();
Logger.WriteLine(LOG_IDENT, "Connectivity check finished");
}
catch (Exception ex)
{
Logger.WriteLine(LOG_IDENT, "Connectivity check failed!");
Logger.WriteException(LOG_IDENT, ex);
if (ex.GetType() == typeof(AggregateException))
ex = ex.InnerException!;
Controls.ShowConnectivityDialog(
"the internet",
$"Something may be preventing {ProjectName} from connecting to the internet, or you are currently offline. Please check and try again.",
ex
);
Terminate(ErrorCode.ERROR_CANCELLED);
}
}
using (var checker = new InstallChecker())
{
checker.Check();

View File

@ -114,6 +114,33 @@ namespace Bloxstrap
return;
}
// connectivity check
App.Logger.WriteLine(LOG_IDENT, "Performing connectivity check...");
try
{
await RobloxDeployment.GetInfo(RobloxDeployment.DefaultChannel);
App.Logger.WriteLine(LOG_IDENT, "Connectivity check finished");
}
catch (Exception ex)
{
App.Logger.WriteLine(LOG_IDENT, "Connectivity check failed!");
App.Logger.WriteException(LOG_IDENT, ex);
string message = $"It's possible that something is preventing {App.ProjectName} from connecting to the internet. Please check and try again.";
if (ex.GetType() == typeof(HttpResponseException))
message = "Roblox may be down right now. See status.roblox.com for more information. Please try again later.";
if (ex.GetType() == typeof(AggregateException))
ex = ex.InnerException!;
Controls.ShowConnectivityDialog("Roblox", message, ex);
App.Terminate(ErrorCode.ERROR_CANCELLED);
}
#if !DEBUG
if (!App.IsFirstRun && App.Settings.Prop.CheckForUpdates)
await CheckForUpdates();
@ -189,24 +216,7 @@ namespace Bloxstrap
{
SetStatus("Connecting to Roblox...");
ClientVersion clientVersion;
try
{
clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
}
catch (Exception ex)
{
string message = "It's possible that Roblox is being blocked by a firewall. Please check and try again.";
if (ex.GetType() == typeof(HttpResponseException))
message = "Roblox may be down right now. See status.roblox.com for more information. Please try again later.";
Controls.ShowConnectivityDialog("Roblox", message, ex);
App.Terminate(ErrorCode.ERROR_CANCELLED);
return;
}
var clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
if (clientVersion.IsBehindDefaultChannel)
{