From 3eaf1037daadc33ae714515a9521a1ddccb29488 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Thu, 23 Jan 2025 01:21:02 -0800 Subject: fix: bridge not closing on device disconnect --- README.md | 6 +++++- server/Brokenithm-Evolved-iOS/Program.cs | 15 +++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8526fce..3534b10 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # Brokenithm-Evolved-iOS-Umi -A version of [esterTion/Brokenithm-iOS](https://github.com/esterTion/Brokenithm-iOS) but maps inputs to keybinds and has support for slider LEDs based on the [Umiguri LED Controller Protocol](https://gist.github.com/inonote/00251fed881a82c9df1e505eef1722bc) +A version of [esterTion/Brokenithm-iOS](https://github.com/esterTion/Brokenithm-iOS) but maps inputs to keybinds and has support for slider LEDs based on the [Umiguri LED Controller Protocol] + +Allows you to use a wired Brokenithm connection with Umiguri and also get all the flashy lights + +(https://gist.github.com/inonote/00251fed881a82c9df1e505eef1722bc) [![Demo](https://files.catbox.moe/w3564o.png)](https://files.catbox.moe/oz9kos.mp4) diff --git a/server/Brokenithm-Evolved-iOS/Program.cs b/server/Brokenithm-Evolved-iOS/Program.cs index f6785cb..931ad63 100644 --- a/server/Brokenithm-Evolved-iOS/Program.cs +++ b/server/Brokenithm-Evolved-iOS/Program.cs @@ -4,11 +4,9 @@ using System; using System.Collections.Generic; using System.Diagnostics; using System.IO.MemoryMappedFiles; -using System.Linq; using System.Security.Principal; using System.Text; using System.Threading; -using System.Threading.Tasks; namespace Brokenithm_Evolved_iOS { @@ -119,11 +117,16 @@ namespace Brokenithm_Evolved_iOS try { Process processToKill = process_map[udid]; - if (!processToKill.HasExited) + Console.WriteLine($"destroying brokenithm-evolved-umi server"); + Process.Start(new ProcessStartInfo { - processToKill.Kill(); - } - processToKill.Dispose(); + FileName = "taskkill", + Arguments = $"/IM brokenithm-evolved-umi.exe /F", + RedirectStandardOutput = true, + RedirectStandardError = true, + UseShellExecute = false, + CreateNoWindow = true + }).WaitForExit(); process_map.Remove(udid); } catch (Exception ex) -- cgit v1.2.3