moved server-settings.json config file to config directory

This commit is contained in:
majormjr 2016-11-01 08:27:50 -04:00
parent 64921908ca
commit dfe08853e4
2 changed files with 3 additions and 1 deletions

View File

@ -49,7 +49,7 @@ type FactorioServerSettings struct {
func initFactorio() *FactorioServer {
f := FactorioServer{}
settingsFile := filepath.Join(config.FactorioDir, config.SettingsFile)
settingsFile := filepath.Join(config.FactorioConfigDir, config.SettingsFile)
if _, err := os.Stat(settingsFile); err == nil {
// server-settings.json file exists

View File

@ -16,6 +16,7 @@ type Config struct {
FactorioSavesDir string `json:"saves_dir"`
FactorioModsDir string `json:"mods_dir"`
FactorioConfigFile string `json:"config_file"`
FactorioConfigDir string `json:"config_directory"`
FactorioLog string `json:"logfile"`
FactorioBinary string `json:"factorio_binary"`
ServerIP string `json:"server_ip"`
@ -70,6 +71,7 @@ func parseFlags() {
config.ServerPort = *factorioPort
config.FactorioSavesDir = filepath.Join(config.FactorioDir, "saves")
config.FactorioModsDir = filepath.Join(config.FactorioDir, "mods")
config.FactorioConfigDir = filepath.Join(config.FactorioDir, "config")
config.FactorioConfigFile = filepath.Join(config.FactorioDir, *factorioConfigFile)
config.FactorioBinary = filepath.Join(config.FactorioDir, *factorioBinary)
config.MaxUploadSize = *factorioMaxUpload