This commit is contained in:
AveryMadness 2024-02-04 13:39:01 -07:00
parent 102c918d63
commit 10733c1d80

View File

@ -38,6 +38,7 @@ namespace Partypacker
InitializeComponent(); InitializeComponent();
InitializeRPC(); InitializeRPC();
Application.Current.Exit += OnApplicationExit; Application.Current.Exit += OnApplicationExit;
Process.GetCurrentProcess().Exited += MainWindow_Exited;
var DiscordURL = PartypackServer.GET("/api/discord/url"); var DiscordURL = PartypackServer.GET("/api/discord/url");
if (!DiscordURL.Key) if (!DiscordURL.Key)
@ -53,6 +54,11 @@ namespace Partypacker
AutoLogin(); AutoLogin();
} }
private void MainWindow_Exited(object? sender, EventArgs e)
{
Proxx?.StopProxy();
}
void OnApplicationExit(object sender, ExitEventArgs e) => Proxx?.StopProxy(); void OnApplicationExit(object sender, ExitEventArgs e) => Proxx?.StopProxy();
void OnChangePort(object sender, TextChangedEventArgs e) { void OnChangePort(object sender, TextChangedEventArgs e) {
if (!int.TryParse(((TextBox)sender).Text, out int P)) if (!int.TryParse(((TextBox)sender).Text, out int P))
@ -177,6 +183,7 @@ namespace Partypacker
}); });
WaitingForGameToOpen = true; WaitingForGameToOpen = true;
GameCheckTimer.Stop(); GameCheckTimer.Stop();
Proxx?.StopProxy();
} }
async void OnLaunch(object sender, RoutedEventArgs e) async void OnLaunch(object sender, RoutedEventArgs e)