From e42108f0895cfb0689dde71808df2c5e11e67b95 Mon Sep 17 00:00:00 2001 From: Mirdinus Date: Sat, 17 Apr 2021 18:08:05 +0200 Subject: [PATCH] Rcon port config Rcon port taken from config file or generated if empty --- src/bootstrap/config.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/config.go b/src/bootstrap/config.go index af89f29..80a8505 100644 --- a/src/bootstrap/config.go +++ b/src/bootstrap/config.go @@ -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