diff --git a/launcher-agent/main.go b/launcher-agent/main.go index 7711856..1e4ec39 100644 --- a/launcher-agent/main.go +++ b/launcher-agent/main.go @@ -14,7 +14,7 @@ import ( "syscall" ) -const revertCmdStart = 6 +const revertCmdStart = 7 func main() { lock := &pidLock.Lock{} @@ -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 { diff --git a/launcher/internal/executor/agent.go b/launcher/internal/executor/agent.go index abcdbc9..86edf1c 100644 --- a/launcher/internal/executor/agent.go +++ b/launcher/internal/executor/agent.go @@ -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 }