Skip to content

Commit 7ce6a4a

Browse files
committed
Look for proxySettings.json in executable directory
1 parent 86102f4 commit 7ce6a4a

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

FlashpointGameServer

408 Bytes
Binary file not shown.

main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,24 @@ var proxy *goproxy.ProxyHttpServer
5656
var cwd string
5757

5858
func initServer() {
59-
// Load the content types from the JSON file
60-
data, err := os.ReadFile("proxySettings.json")
59+
//Get the CWD of this application
60+
exe, err := os.Executable()
6161
if err != nil {
6262
panic(err)
6363
}
64+
cwd = filepath.Dir(exe)
6465

65-
// Unmarshal the JSON data into a Config struct
66-
err = json.Unmarshal(data, &serverSettings)
66+
// Load the content types from the JSON file
67+
data, err := os.ReadFile(filepath.Join(cwd, "proxySettings.json"))
6768
if err != nil {
6869
panic(err)
6970
}
7071

71-
//Get the CWD of this application
72-
exe, err := os.Executable()
72+
// Unmarshal the JSON data into a Config struct
73+
err = json.Unmarshal(data, &serverSettings)
7374
if err != nil {
7475
panic(err)
7576
}
76-
cwd = strings.ReplaceAll(filepath.Dir(exe), "\\", "/")
7777

7878
//TODO: Update proxySettings.LegacyHTDOCSPath AND proxySettings.LegacyPHPPath for the default values!
7979

0 commit comments

Comments
 (0)