-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
39 lines (32 loc) · 960 Bytes
/
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
package main
import (
"io/ioutil"
"os"
"github.com/JoshuaDoes/bedrocksrv/config"
"github.com/JoshuaDoes/bedrocksrv/errors"
)
var (
cfg = &config.Config{}
)
func main() {
initLogging(ioutil.Discard, os.Stdout, os.Stdout, os.Stderr)
Info.Println("bedrocksrv © JoshuaDoes: 2018.")
Info.Println(BuildID)
Info.Println("> Loading server configuration...")
err := cfg.Load("config.json")
if err != nil {
if err == errors.ErrCfgNotFound {
Warning.Println("Configuration not found, using default configuration")
} else {
Error.Println(err)
}
}
Info.Println("-- [START] DISPLAY CONFIG --")
Info.Printf("Message of the Day: %s\n", cfg.MOTD)
Info.Printf("Server Name: %s\n", cfg.SrvName)
Info.Printf("Server Port: %d\n", cfg.SrvPort)
Info.Printf("Game Mode: %d\n", cfg.GameMode)
Info.Printf("Max Players: %d\n", cfg.MaxPlayers)
Info.Printf("Spawn Protection: %v\n", cfg.SpawnProtection)
Info.Println("-- [END] DISPLAY CONFIG --")
}