Skip to content

Commit

Permalink
fix utility func
Browse files Browse the repository at this point in the history
  • Loading branch information
iholston committed Sep 14, 2023
1 parent fd637b1 commit 3bb5238
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# PROCESS NAMES
LEAGUE_PROCESS_NAMES = ["LeagueClient.exe", "League of Legends.exe"]
RIOT_CLIENT_PROCESS_NAMES = "RiotClientUx.exe"
RIOT_CLIENT_PROCESS_NAMES = ["RiotClientUx.exe"]

# COMMANDS
KILL_LEAGUE_CLIENT = 'TASKKILL /F /IM LeagueClient.exe'
Expand Down
8 changes: 8 additions & 0 deletions scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ def is_league_running():
return True
return False

def is_rc_running():
res = subprocess.check_output(["TASKLIST"], creationflags=0x08000000)
output = str(res)
for name in RIOT_CLIENT_PROCESS_NAMES:
if name in output:
return True
return False

def close_processes():
log.info("Terminating league related processes.")
os.system(KILL_LEAGUE)
Expand Down

0 comments on commit 3bb5238

Please sign in to comment.