diff --git a/src/Connections.cs b/src/Connections.cs index ca82e2b..48b03bb 100644 --- a/src/Connections.cs +++ b/src/Connections.cs @@ -36,7 +36,7 @@ public static void ErrorReport(string? errorMessage = "Unknown", string? stackTr { RequestUri = BuildEnvironment.ErrorReportingEndpoint, Method = HttpMethod.Post, - Content = new StringContent("{\"a\":\"" + errorMessage + "\",\"b\":\"None\",\"c\":0,\"d\":0,\"e\":\"" + safeStackTrace + "\",\"f\":\"NitroType Cheat\"}", Encoding.UTF8, "application/json"), + Content = new StringContent("{\"a\":\"" + errorMessage + "\",\"b\":\"None\",\"c\":0,\"d\":0,\"e\":\"" + safeStackTrace + "\",\"f\":\"NitroType Cheat v" + Updates.VersionCode + "\"}", Encoding.UTF8, "application/json"), }; try @@ -46,5 +46,22 @@ public static void ErrorReport(string? errorMessage = "Unknown", string? stackTr catch (Exception) { } } } + + public static void OpenLink(string url) + { + try + { + System.Diagnostics.Process.Start("explorer.exe", url); + } + catch (Exception) + { + MessageBox.Show( + "Error: Couldn't open link, lacking permissions.\n\n" + url, + "Internal Error", + MessageBoxButtons.OK, + MessageBoxIcon.Error + ); + } + } } } diff --git a/src/Form1.cs b/src/Form1.cs index bb35aab..d9d63e0 100644 --- a/src/Form1.cs +++ b/src/Form1.cs @@ -183,7 +183,7 @@ private void UI_Update_Godmode(object? sender, EventArgs e) private void UI_Click_Discord(object sender, EventArgs e) { Logger.Log("Discord Button Clicked"); - System.Diagnostics.Process.Start("explorer.exe", BuildEnvironment.DiscordLink); + Connections.OpenLink(BuildEnvironment.DiscordLink); } private async void UI_Click_Start(object sender, EventArgs e) diff --git a/src/Program.cs b/src/Program.cs index 63a1df8..1a475ef 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -81,7 +81,7 @@ static async void ShouldUpdate() if (WantsUpdate == DialogResult.Yes) { Logger.Log("Opening Update Link"); - System.Diagnostics.Process.Start("explorer.exe", "https://github.com/kgsensei/NitroTypeHack2/releases/latest"); + Connections.OpenLink("https://github.com/kgsensei/NitroTypeHack2/releases/latest"); } } } diff --git a/src/Updates.cs b/src/Updates.cs index f00cf7b..c66f357 100644 --- a/src/Updates.cs +++ b/src/Updates.cs @@ -2,7 +2,7 @@ { class Updates { - public static string VersionCode = "4.6.1"; + public static string VersionCode = "4.6.2"; public static async Task ShouldUpdate() { diff --git a/version b/version index f4fa8fc..3208b09 100644 --- a/version +++ b/version @@ -1 +1 @@ -4.6.1 \ No newline at end of file +4.6.2 \ No newline at end of file