Added default config if config.yml is missing

Default config:
server:
  serverFolder: "factorio"
  worldFile: "factorio/saves/newworld.zip"
  serverSettings: "factorio/data/server-settings.json"
  serverExec: "factorio/bin/x64/factorio"
  port: 34197

factoryman:
  screen: True
  screenName: "Factorio"
  backupDir: "factorio/backups"
  username: ""
  apitoken: ""
This commit is contained in:
2026-05-04 12:41:18 -06:00
parent e051d2d6f6
commit 9e7bd21602
4 changed files with 36 additions and 2 deletions

View File

@@ -19,6 +19,24 @@ type UsrConfig struct {
} `yaml:"factoryman"`
}
type DefConfig struct {
Server struct { // server specific settings
ServDir string
WorldFile string
ServCfg string
ServExec string
ServPort int
}
Factoryman struct { // factoryman settings
BackupDir string
UseScreen bool
ScreenName string
UserName string
ApiToken string
}
}
// JSON file from config
type Mod struct {
Name string `json:"name"`