From c0e16b115c78ee3f6246a5b440445034c445cb20 Mon Sep 17 00:00:00 2001 From: Mike Oliphant Date: Thu, 13 Jun 2024 13:03:48 -0700 Subject: [PATCH] Shutdown network connection thread on exit --- StompboxRemote/Program.cs | 2 +- StompboxShared/StompboxClient.cs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/StompboxRemote/Program.cs b/StompboxRemote/Program.cs index f6f86e4..6f92a34 100644 --- a/StompboxRemote/Program.cs +++ b/StompboxRemote/Program.cs @@ -22,6 +22,6 @@ GameHost.IsMouseVisible = true; GameHost.StartGame(game); - StompboxClient.Instance.NeedUIReload = true; + client.Disconnect(); } diff --git a/StompboxShared/StompboxClient.cs b/StompboxShared/StompboxClient.cs index 14e76f5..28e4be3 100644 --- a/StompboxShared/StompboxClient.cs +++ b/StompboxShared/StompboxClient.cs @@ -149,6 +149,14 @@ public void Connect(string serverName, int port, Action connectCallback) } } + public void Disconnect() + { + if (InClientMode) + { + networkClient.Stop(); + } + } + void ConnectCallback(bool result) { if (result)