diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs
index 1d85017..f2b9421 100644
--- a/Bloxstrap/App.xaml.cs
+++ b/Bloxstrap/App.xaml.cs
@@ -165,16 +165,13 @@ namespace Bloxstrap
if (ex.GetType() == typeof(AggregateException))
ex = ex.InnerException!;
- Controls.ShowMessageBox(
- "Bloxstrap is unable to connect to the internet. Please check your network configuration and try again.\n" +
- "\n" +
- "More information:\n" +
- ex.Message,
- MessageBoxImage.Error,
- MessageBoxButton.OK
+ 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();
+ Terminate(ErrorCode.ERROR_CANCELLED);
}
}
diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs
index ce8f537..85eaaf2 100644
--- a/Bloxstrap/Bootstrapper.cs
+++ b/Bloxstrap/Bootstrapper.cs
@@ -4,7 +4,6 @@ using System.Windows.Forms;
using Microsoft.Win32;
using Bloxstrap.Integrations;
-using System;
namespace Bloxstrap
{
@@ -190,7 +189,24 @@ namespace Bloxstrap
{
SetStatus("Connecting to Roblox...");
- ClientVersion clientVersion = await RobloxDeployment.GetInfo(App.Settings.Prop.Channel);
+ 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;
+ }
if (clientVersion.IsBehindDefaultChannel)
{
diff --git a/Bloxstrap/GlobalUsings.cs b/Bloxstrap/GlobalUsings.cs
index e66b091..105c8d9 100644
--- a/Bloxstrap/GlobalUsings.cs
+++ b/Bloxstrap/GlobalUsings.cs
@@ -15,6 +15,7 @@ global using System.Threading;
global using System.Threading.Tasks;
global using Bloxstrap.Enums;
+global using Bloxstrap.Exceptions;
global using Bloxstrap.Extensions;
global using Bloxstrap.Models;
global using Bloxstrap.Models.BloxstrapRPC;
diff --git a/Bloxstrap/RobloxDeployment.cs b/Bloxstrap/RobloxDeployment.cs
index 70efe89..30267d2 100644
--- a/Bloxstrap/RobloxDeployment.cs
+++ b/Bloxstrap/RobloxDeployment.cs
@@ -1,6 +1,4 @@
-using Bloxstrap.Exceptions;
-
-namespace Bloxstrap
+namespace Bloxstrap
{
public static class RobloxDeployment
{
diff --git a/Bloxstrap/UI/Controls.cs b/Bloxstrap/UI/Controls.cs
index bb42bfe..74786b1 100644
--- a/Bloxstrap/UI/Controls.cs
+++ b/Bloxstrap/UI/Controls.cs
@@ -39,6 +39,14 @@ namespace Bloxstrap.UI
});
}
+ public static void ShowConnectivityDialog(string targetName, string description, Exception exception)
+ {
+ Application.Current.Dispatcher.Invoke(() =>
+ {
+ new ConnectivityDialog(targetName, description, exception).ShowDialog();
+ });
+ }
+
public static IBootstrapperDialog GetBootstrapperDialog(BootstrapperStyle style)
{
return style switch
diff --git a/Bloxstrap/UI/Elements/Dialogs/ConnectivityDialog.xaml b/Bloxstrap/UI/Elements/Dialogs/ConnectivityDialog.xaml
new file mode 100644
index 0000000..9a9f464
--- /dev/null
+++ b/Bloxstrap/UI/Elements/Dialogs/ConnectivityDialog.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Bloxstrap/UI/Elements/Dialogs/ConnectivityDialog.xaml.cs b/Bloxstrap/UI/Elements/Dialogs/ConnectivityDialog.xaml.cs
new file mode 100644
index 0000000..806a91f
--- /dev/null
+++ b/Bloxstrap/UI/Elements/Dialogs/ConnectivityDialog.xaml.cs
@@ -0,0 +1,42 @@
+using System.Media;
+using System.Windows.Interop;
+
+namespace Bloxstrap.UI.Elements.Dialogs
+{
+ // hmm... do i use MVVM for this?
+ // this is entirely static, so i think im fine without it, and this way is just so much more efficient
+
+ ///
+ /// Interaction logic for ExceptionDialog.xaml
+ ///
+ public partial class ConnectivityDialog
+ {
+ 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}";
+
+ CloseButton.Click += delegate
+ {
+ Close();
+ };
+
+ SystemSounds.Hand.Play();
+
+ Loaded += delegate
+ {
+ IntPtr hWnd = new WindowInteropHelper(this).Handle;
+ NativeMethods.FlashWindow(hWnd, true);
+ };
+ }
+ }
+}
diff --git a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs
index 79bb4cc..da81ace 100644
--- a/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs
+++ b/Bloxstrap/UI/ViewModels/Menu/BehaviourViewModel.cs
@@ -1,6 +1,4 @@
-using Bloxstrap.Exceptions;
-
-namespace Bloxstrap.UI.ViewModels.Menu
+namespace Bloxstrap.UI.ViewModels.Menu
{
public class BehaviourViewModel : NotifyPropertyChangedViewModel
{