mirror of
https://github.com/ehang-io/nps.git
synced 2025-07-04 05:40:43 +00:00
Merge pull request #613 from xiexiao/master
Windows服务运行npc时读取程序目录下的config文件
This commit is contained in:
commit
22e1eabb55
@ -239,7 +239,7 @@ func run() {
|
|||||||
}()
|
}()
|
||||||
} else {
|
} else {
|
||||||
if *configPath == "" {
|
if *configPath == "" {
|
||||||
*configPath = "conf/npc.conf"
|
*configPath = common.GetConfigPath()
|
||||||
}
|
}
|
||||||
go client.StartFromFile(*configPath)
|
go client.StartFromFile(*configPath)
|
||||||
}
|
}
|
||||||
|
@ -76,3 +76,14 @@ func GetTmpPath() string {
|
|||||||
}
|
}
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//config file path
|
||||||
|
func GetConfigPath() string {
|
||||||
|
var path string
|
||||||
|
if IsWindows() {
|
||||||
|
path = filepath.Join(GetAppPath(), "conf/npc.conf")
|
||||||
|
} else {
|
||||||
|
path = "conf/npc.conf"
|
||||||
|
}
|
||||||
|
return path
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user