Skip to content

Commit

Permalink
Fix: Correctly pass game id to agent
Browse files Browse the repository at this point in the history
  • Loading branch information
luskaner committed Nov 4, 2024
1 parent ed722f9 commit bb4be68
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 3 additions & 3 deletions launcher-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"syscall"
)

const revertCmdStart = 6
const revertCmdStart = 7

func main() {
lock := &pidLock.Lock{}
Expand All @@ -37,8 +37,8 @@ func main() {
if runtime.GOOS == "windows" {
broadcastBattleServer, _ = strconv.ParseBool(os.Args[4])
}
gameId := os.Args[7]
revertCmdLength, _ := strconv.ParseInt(os.Args[5], 10, 64)
gameId := os.Args[5]
revertCmdLength, _ := strconv.ParseInt(os.Args[6], 10, 64)
revertCmdEnd := revertCmdStart + revertCmdLength
var revertCmd []string
if revertCmdLength > 0 {
Expand Down
16 changes: 14 additions & 2 deletions launcher/internal/executor/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,21 @@ func RunAgent(game string, steamProcess bool, microsoftStoreProcess bool, server
if serverExe == "" {
serverExe = "-"
}
args := []string{strconv.FormatBool(steamProcess), strconv.FormatBool(microsoftStoreProcess), serverExe, strconv.FormatBool(broadCastBattleServer), strconv.FormatUint(uint64(len(revertCommand)), 10)}
args := []string{
strconv.FormatBool(steamProcess),
strconv.FormatBool(microsoftStoreProcess),
serverExe,
strconv.FormatBool(broadCastBattleServer),
game,
strconv.FormatUint(uint64(len(revertCommand)), 10),
}
args = append(args, revertCommand...)
args = append(args, RevertFlags(game, unmapIPs, removeUserCert, removeLocalCert, restoreMetadata, restoreProfiles, unmapCDN)...)
if unmapCDN || unmapIPs || removeUserCert || removeLocalCert || restoreMetadata || restoreProfiles {
args = append(
args,
RevertFlags(game, unmapIPs, removeUserCert, removeLocalCert, restoreMetadata, restoreProfiles, unmapCDN)...,
)
}
result = exec.Options{File: common.GetExeFileName(false, common.LauncherAgent), Pid: true, Args: args}.Exec()
return
}

0 comments on commit bb4be68

Please sign in to comment.