-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.go
49 lines (41 loc) · 1.01 KB
/
main.go
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
39
40
41
42
43
44
45
46
47
48
package main
import (
"time"
"log"
"strings"
)
func main() {
log.Println("Loading config file config.json..")
config, err := ReadConfig("config.json")
if err != nil {
log.Println("Fatal error opening config.json file. Error: ", err)
return;
}
log.Println("Config file loaded.")
SetAllowedMaps(strings.Split(config.CSMaps, ","))
SetTeamName(strings.Split(config.TeamNames, ","))
log.Println("Set available maps: " + GetValidMaps())
log.Println("Testing connectivity to CS server(s)..")
if !SetupAndTestCSServers(config.CSServers) {
return;
}
irc = &IRC{
config.IRCServer, //server
config.IRCPassword, //password
config.IRCNickname, //nickname
config.IRCUsername, //username
"", //internal IP
"", //external IP
config.IRCChannels, //channel
nil, // net.Conn
false, //irc connected
false, //irc protocol debug
Message{},
time.Now(), // pingTime
false, //ping sent
false, //pong received
false, //joined channel
}
log.Println("Starting main IRC loop..")
irc.IRCLoop()
}