File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,19 @@ func logSubscribe(client *Client, data interface{}) {
2222}
2323
2424func commandSend (client * Client , data interface {}) {
25- go func () {
26- log .Printf ("Received command: %v" , data )
25+ if FactorioServ .Running {
26+ go func () {
27+ log .Printf ("Received command: %v" , data )
2728
28- req_id , err := FactorioServ .Rcon .Write (data .(string ))
29- if err != nil {
30- log .Printf ("Error sending rcon command: %s" , err )
31- return
32- }
29+ req_id , err := FactorioServ .Rcon .Write (data .(string ))
30+ if err != nil {
31+ log .Printf ("Error sending rcon command: %s" , err )
32+ return
33+ }
3334
34- log .Printf ("Command send to Factorio: %s, with rcon request id: %v" , data , req_id )
35+ log .Printf ("Command send to Factorio: %s, with rcon request id: %v" , data , req_id )
3536
36- client .send <- Message {"receive command" , data }
37- }()
37+ client .send <- Message {"receive command" , data }
38+ }()
39+ }
3840}
You can’t perform that action at this time.
0 commit comments