Skip to content

Commit bb4be68

Browse files
committed
Fix: Correctly pass game id to agent
1 parent ed722f9 commit bb4be68

2 files changed

Lines changed: 17 additions & 5 deletions

File tree

launcher-agent/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"syscall"
1515
)
1616

17-
const revertCmdStart = 6
17+
const revertCmdStart = 7
1818

1919
func main() {
2020
lock := &pidLock.Lock{}
@@ -37,8 +37,8 @@ func main() {
3737
if runtime.GOOS == "windows" {
3838
broadcastBattleServer, _ = strconv.ParseBool(os.Args[4])
3939
}
40-
gameId := os.Args[7]
41-
revertCmdLength, _ := strconv.ParseInt(os.Args[5], 10, 64)
40+
gameId := os.Args[5]
41+
revertCmdLength, _ := strconv.ParseInt(os.Args[6], 10, 64)
4242
revertCmdEnd := revertCmdStart + revertCmdLength
4343
var revertCmd []string
4444
if revertCmdLength > 0 {

launcher/internal/executor/agent.go

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,21 @@ func RunAgent(game string, steamProcess bool, microsoftStoreProcess bool, server
1010
if serverExe == "" {
1111
serverExe = "-"
1212
}
13-
args := []string{strconv.FormatBool(steamProcess), strconv.FormatBool(microsoftStoreProcess), serverExe, strconv.FormatBool(broadCastBattleServer), strconv.FormatUint(uint64(len(revertCommand)), 10)}
13+
args := []string{
14+
strconv.FormatBool(steamProcess),
15+
strconv.FormatBool(microsoftStoreProcess),
16+
serverExe,
17+
strconv.FormatBool(broadCastBattleServer),
18+
game,
19+
strconv.FormatUint(uint64(len(revertCommand)), 10),
20+
}
1421
args = append(args, revertCommand...)
15-
args = append(args, RevertFlags(game, unmapIPs, removeUserCert, removeLocalCert, restoreMetadata, restoreProfiles, unmapCDN)...)
22+
if unmapCDN || unmapIPs || removeUserCert || removeLocalCert || restoreMetadata || restoreProfiles {
23+
args = append(
24+
args,
25+
RevertFlags(game, unmapIPs, removeUserCert, removeLocalCert, restoreMetadata, restoreProfiles, unmapCDN)...,
26+
)
27+
}
1628
result = exec.Options{File: common.GetExeFileName(false, common.LauncherAgent), Pid: true, Args: args}.Exec()
1729
return
1830
}

0 commit comments

Comments
 (0)