Skip to content

Commit

Permalink
Update game running check with new executable names
Browse files Browse the repository at this point in the history
  • Loading branch information
budak7273 committed Sep 12, 2024
1 parent 5b559d6 commit b3e38e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion backend/ficsitcli/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ficsitcli
import (
"fmt"
"log/slog"
"slices"
"sync"
"time"

Expand Down Expand Up @@ -45,6 +46,8 @@ func Init() error {
return nil
}

var executableNames = []string{"FactoryGame-Win64-Shipping.exe", "FactoryGame-Win64-Shipping", "FactoryGameSteam-Win64-Shipping", "FactoryGameEGS-Win64-Shipping"}

func (f *ficsitCLI) StartGameRunningWatcher() {
gameRunningTicker := time.NewTicker(5 * time.Second)
go func() {
Expand All @@ -56,7 +59,7 @@ func (f *ficsitCLI) StartGameRunningWatcher() {
}
f.isGameRunning = false
for _, process := range processes {
if process.Executable() == "FactoryGame-Win64-Shipping.exe" || process.Executable() == "FactoryGame-Win64-Shipping" {
if slices.Contains(executableNames, process.Executable()) {
f.isGameRunning = true
break
}
Expand Down
1 change: 1 addition & 0 deletions backend/installfinders/common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package common
type GameBranch string

var (
// TODO rename to BranchRelease later https://github.com/satisfactorymodding/SatisfactoryModManager/pull/223#issuecomment-2342831142
BranchEarlyAccess GameBranch = "Early Access"
BranchExperimental GameBranch = "Experimental"
)
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"Unignore",
"urql",
"wailsjs",
"wailsjsdir"
"wailsjsdir",
"xsync"
],
// flagWords - list of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
Expand Down

0 comments on commit b3e38e1

Please sign in to comment.