Skip to content

Commit 7c05665

Browse files
author
aperkovic
committed
Removed extra log line, moving autostart feature to new development branch
1 parent 759aae4 commit 7c05665

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

src/factorio_server.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,6 @@ func randomPort() int {
4242
// Returns random port to use for rcon connection
4343
return rand.Intn(45000-40000) + 40000
4444
}
45-
func autostart() {
46-
47-
var err error
48-
if FactorioServ.BindIP == "" {
49-
FactorioServ.BindIP = "0.0.0.0"
50-
51-
}
52-
if FactorioServ.Port == 0 {
53-
FactorioServ.Port = 34197
54-
}
55-
FactorioServ.Savefile = "Load Latest"
56-
57-
err = FactorioServ.Run()
58-
59-
if err != nil {
60-
log.Printf("Error starting Factorio server: %+v", err)
61-
return
62-
}
63-
64-
}
6545

6646
func initFactorio() (f *FactorioServer, err error) {
6747
f = new(FactorioServer)
@@ -153,10 +133,6 @@ func initFactorio() (f *FactorioServer, err error) {
153133

154134
f.BaseModVersion = modInfo.Version
155135

156-
if config.autostart == "true" {
157-
go autostart()
158-
}
159-
160136
return
161137
}
162138

@@ -192,8 +168,6 @@ func (f *FactorioServer) Run() error {
192168
args = append(args, "--start-server", filepath.Join(config.FactorioSavesDir, f.Savefile))
193169
}
194170

195-
log.Println("Starting server with command: ", config.FactorioBinary, args)
196-
197171
if config.glibcCustom == "true" {
198172
log.Println("Starting server with command: ", config.glibcLocation, args)
199173
f.Cmd = exec.Command(config.glibcLocation, args...)

src/main.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ type Config struct {
3737
glibcCustom string
3838
glibcLocation string
3939
glibcLibLoc string
40-
autostart string
4140
}
4241

4342
var (
@@ -79,10 +78,8 @@ func parseFlags() {
7978
glibcCustom := flag.String("glibc-custom", "false", "By default false, if custom glibc is required set this to true and add glibc-loc and glibc-lib-loc parameters")
8079
glibcLocation := flag.String("glibc-loc", "/opt/glibc-2.18/lib/ld-2.18.so", "Location glibc ld.so file if needed (ex. /opt/glibc-2.18/lib/ld-2.18.so)")
8180
glibcLibLoc := flag.String("glibc-lib-loc", "/opt/glibc-2.18/lib", "Location of glibc lib folder (ex. /opt/glibc-2.18/lib)")
82-
autostart := flag.String("autostart", "false", "Autostart factorio server on bootup of FSM, default false [true/false]")
8381

8482
flag.Parse()
85-
config.autostart = *autostart
8683
config.glibcCustom = *glibcCustom
8784
config.glibcLocation = *glibcLocation
8885
config.glibcLibLoc = *glibcLibLoc

0 commit comments

Comments
 (0)