diff --git a/BorderlandsDiscordRP/Integration.cs b/BorderlandsDiscordRP/Integration.cs index 7cd4e38..0573f4a 100644 --- a/BorderlandsDiscordRP/Integration.cs +++ b/BorderlandsDiscordRP/Integration.cs @@ -81,10 +81,11 @@ public static int Create() return 1; } - var process = Process.Start(Path.Combine(dir, game)); - setupClient(); + Process process = Process.Start(Path.Combine(dir, game)); + Thread child = setupClient(); process.WaitForExit(); client.ClearPresence(); + child.Abort(); //Testing Code //ManualResetEvent Wait = new ManualResetEvent(false); @@ -95,7 +96,7 @@ public static int Create() #endregion #region Setup - private static void setupClient() + private static Thread setupClient() { connected = false; @@ -127,6 +128,8 @@ private static void setupClient() while (childThread.IsAlive) continue; + return childThread; + } public static void CallToChildThread() @@ -414,7 +417,7 @@ private static string mapFileToActualMap(string map) return "Wam Bam Island"; #endregion #region Lilith - if (map.StartsWith("sanctintro")) + if (map.StartsWith("sanctintro") || map.StartsWith("gaiussanctuary")) return "Sanctuary"; if (map.StartsWith("backburner")) return "The Backburner";