Rcon port config

Rcon port taken from config file or generated if empty
This commit is contained in:
Mirdinus 2021-04-17 18:08:05 +02:00
parent 8ff0cfa725
commit e42108f089

View File

@ -177,8 +177,11 @@ func (config *Config) loadServerConfig() {
config.FactorioAdminFile = filepath.Join(config.FactorioConfigDir, config.FactorioAdminFile)
}
// Set random port as rconPort
config.FactorioRconPort = randomPort()
if config.FactorioRconPort == 0 {
config.FactorioRconPort = randomPort()
log.Println("Rcon port is empty, generated new one:")
log.Printf("Port number: %v", config.FactorioRconPort)
}
}
// Returns random port to use for rcon connection