Skip to content

Commit

Permalink
Launcher: Now server lookup path for consistency (with former path 3)…
Browse files Browse the repository at this point in the history
… include for 2nd priority ./server/server.exe.
  • Loading branch information
luskaner committed Aug 12, 2024
1 parent c8793f9 commit 4ce87fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion launcher/internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func Execute() error {
rootCmd.PersistentFlags().StringSliceP("serverAnnouncePorts", "n", []string{strconv.Itoa(common.AnnouncePort)}, `Announce ports to listen to. If not including the default port, default configured servers will not get discovered.`)
rootCmd.PersistentFlags().StringP("server", "s", "", `Hostname of the server to connect to. If not absent, serverStart will be assumed to be false. Ignored otherwise`)
serverExe := common.GetExeFileName(false, common.Server)
rootCmd.PersistentFlags().StringP("serverPath", "e", "auto", fmt.Sprintf(`The executable path of the server, "auto", will be try to execute in this order ".\%s", "..\%s" and finally "..\%s\%s"", otherwise set the path (relative or absolute).`, serverExe, serverExe, common.Server, serverExe))
rootCmd.PersistentFlags().StringP("serverPath", "e", "auto", fmt.Sprintf(`The executable path of the server, "auto", will be try to execute in this order ".\%s", ".\%s\%s", "..\%s" and finally "..\%s\%s", otherwise set the path (relative or absolute).`, serverExe, common.Server, serverExe, serverExe, common.Server, serverExe))
rootCmd.PersistentFlags().StringArrayP("serverPathArgs", "r", []string{}, `The arguments to pass to the server executable if starting it. Can be set multiple times. See the server for available arguments.`)
rootCmd.PersistentFlags().StringP("clientExe", "l", "auto", `The type of game client or the path. "auto" will use the Steam and then the Microsoft Store one if found. Use a path to the game launcher, "steam" or "msstore" to use the default launcher.`)
rootCmd.PersistentFlags().StringArrayP("clientExeArgs", "i", []string{}, `The arguments to pass to the client launcher if it is custom. Can be set multiple times.`)
Expand Down
2 changes: 1 addition & 1 deletion launcher/internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"time"
)

var autoServerDir = []string{`\`, `\..\`, fmt.Sprintf(`\..\%s\`, common.Server)}
var autoServerDir = []string{`\`, fmt.Sprintf(`\%s\`, common.Server), `\..\`, fmt.Sprintf(`\..\%s\`, common.Server)}
var autoServerName = []string{common.GetExeFileName(true, common.Server)}

func StartServer(stop string, executable string, args []string) (result *commonExecutor.ExecResult, executablePath string, ip string) {
Expand Down
5 changes: 3 additions & 2 deletions launcher/resources/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ IsolateProfiles = false
Start = auto
# The process to start the server, if 'auto', it will be try to execute in this order:
# 1. ".\server.exe"
# 2. "..\server.exe"
# 3. "..\server\server.exe"
# 2. ".\server\server.exe"
# 3. "..\server.exe"
# 4. "..\server\server.exe"
Executable = auto
# The arguments to pass to the server executable if starting it. See the server for available arguments
ExecutableArgs =
Expand Down

0 comments on commit 4ce87fe

Please sign in to comment.