From 3f07dafe0bc005a5ad1cd8e1329357c304d0b60d Mon Sep 17 00:00:00 2001 From: Ombrezz <37753837+Ombrezz@users.noreply.github.com> Date: Tue, 12 Sep 2023 21:38:50 -0400 Subject: [PATCH] Fix #284 Only count Northstar as running if it's not a dedicated server. --- src-tauri/src/util.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/util.rs b/src-tauri/src/util.rs index b21b2208d..451f9ef19 100644 --- a/src-tauri/src/util.rs +++ b/src-tauri/src/util.rs @@ -136,12 +136,14 @@ pub fn check_ea_app_or_origin_running() -> bool { /// Checks if Northstar process is running pub fn check_northstar_running() -> bool { let s = sysinfo::System::new_all(); - let x = s - .processes_by_name("NorthstarLauncher.exe") - .next() - .is_some() - || s.processes_by_name("Titanfall2.exe").next().is_some(); - x + for (_, process) in s.processes() { + if (process.name().ends_with("Titanfall2.exe") || process.name().ends_with("Northstar.exe")) + && !process.cmd().contains(&String::from("-dedicated")) + { + return true; + } + } + false } /// Copies a folder and all its contents to a new location