mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Merge branch 'bugfix-490' into version-2.5.1
This commit is contained in:
commit
db92b80e4c
@ -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();
|
||||
|
@ -7,8 +7,8 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<UseWindowsForms>True</UseWindowsForms>
|
||||
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
|
||||
<Version>2.5.0</Version>
|
||||
<FileVersion>2.5.0.0</FileVersion>
|
||||
<Version>2.5.1</Version>
|
||||
<FileVersion>2.5.1.0</FileVersion>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -16,17 +16,12 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
||||
{
|
||||
public ConnectivityDialog(string targetName, string description, Exception exception)
|
||||
{
|
||||
Exception? innerException = exception.InnerException;
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
TitleTextBlock.Text = $"{App.ProjectName} is unable to connect to {targetName}";
|
||||
DescriptionTextBlock.Text = description;
|
||||
|
||||
ErrorRichTextBox.Selection.Text = $"{exception.GetType()}: {exception.Message}";
|
||||
|
||||
if (innerException is not null)
|
||||
ErrorRichTextBox.Selection.Text += $"\n\n===== Inner Exception =====\n{innerException.GetType()}: {innerException.Message}";
|
||||
AddException(exception);
|
||||
|
||||
CloseButton.Click += delegate
|
||||
{
|
||||
@ -41,5 +36,18 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
||||
PInvoke.FlashWindow((HWND)hWnd, true);
|
||||
};
|
||||
}
|
||||
|
||||
private void AddException(Exception exception, bool inner = false)
|
||||
{
|
||||
if (!inner)
|
||||
ErrorRichTextBox.Selection.Text = $"{exception.GetType()}: {exception.Message}";
|
||||
|
||||
if (exception.InnerException is null)
|
||||
return;
|
||||
|
||||
ErrorRichTextBox.Selection.Text += $"\n\n[Inner Exception]\n{exception.InnerException.GetType()}: {exception.InnerException.Message}";
|
||||
|
||||
AddException(exception.InnerException, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user