-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (29 loc) · 820 Bytes
/
main.go
File metadata and controls
38 lines (29 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"log"
"strings"
"time"
"github.com/pattack/fcjanstun/team"
"github.com/pattack/rcss"
)
var (
Application string = "fcjanstun"
cfgDir string = "/etc/" + Application
cfgFilename string = cfgDir + "/conf.toml"
)
func init() {
log.SetFlags(log.Lshortfile)
log.SetPrefix("FCJanstun :: " + strings.ToUpper(Application) + " :: ")
}
func main() {
cfg := LoadConfigs(defaultConfig(Application, cfgFilename))
log.Printf("server address: %s\n", cfg.serverAddress)
log.Printf("initalizing `%s` team\n", cfg.teamName)
if srv, err := rcss.NewServer(cfg.serverAddress); err != nil {
panic(err)
} else if err := srv.Join(team.NewTeam(cfg.teamName)); err != nil {
panic(err)
}
// TODO: Remove this. Wait for stop signal and do graceful shutdown instead
<-time.After(time.Hour)
}