fix(all): stabilize login and proxy-aware game startup
This commit is contained in:
@@ -25,6 +25,16 @@ func launchGame(target string) error {
|
||||
if err := exec.Command("pgrep", "-x", "BrownDust II").Run(); err == nil {
|
||||
return errGameAlreadyRunning
|
||||
}
|
||||
args := append([]string{target, "--args"}, gameLaunchArguments()...)
|
||||
// LaunchServices does not inherit open's environment; --env explicitly
|
||||
// supplies the Unity variables to the newly launched application.
|
||||
args := []string{target}
|
||||
for _, entry := range gameProxyEnvironment(os.Environ(), systemGameProxy()) {
|
||||
key, _, found := strings.Cut(entry, "=")
|
||||
if found && (strings.EqualFold(key, "UNITY_PROXYSERVER") || strings.EqualFold(key, "UNITY_NOPROXY")) {
|
||||
args = append(args, "--env", entry)
|
||||
}
|
||||
}
|
||||
args = append(args, "--args")
|
||||
args = append(args, gameLaunchArguments()...)
|
||||
return exec.Command("open", args...).Start()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user