mirror of
https://github.com/OpenFactorioServerManager/factorio-server-manager.git
synced 2025-01-24 05:17:24 +02:00
22 lines
415 B
Go
22 lines
415 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"strconv"
|
|
|
|
"github.com/majormjr/rcon"
|
|
)
|
|
|
|
func connectRC() error {
|
|
var err error
|
|
rconAddr := config.ServerIP + ":" + strconv.Itoa(config.FactorioRconPort)
|
|
FactorioServ.Rcon, err = rcon.Dial(rconAddr, config.FactorioRconPass)
|
|
if err != nil {
|
|
log.Printf("Cannot create rcon session: %s", err)
|
|
return err
|
|
}
|
|
log.Printf("rcon session established on %s", rconAddr)
|
|
|
|
return nil
|
|
}
|