-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
74 lines (52 loc) · 1.48 KB
/
config.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package oconfig
import (
"strings"
)
const (
ConfigVersion = "0.1-beta"
LoggingTypeGlobal = "global"
LoggingTypePerPlayer = "per_player"
DefaultShutdownMessage = "<red>Server is restarting.</red>"
)
type Config struct {
Version string `json:"version"`
AuthKey string `json:"auth_key"`
Branch string `json:"branch"`
LocalAddress string `json:"local_addr"`
RemoteAddress string `json:"remote_addr"`
BackupAddress string `json:"backup_addr"`
SpectrumKey string `json:"spectrum_key"`
LoggingType string `json:"logging_type"`
LogFile string `json:"log_file"`
ShutdownMessage string `json:"shutdown_message"`
Resource ResourceOpts `json:"resource_opts"`
Movement MovementOpts `json:"movement_opts"`
Moderators []string `json:"moderators"`
}
type ResourceOpts struct {
ResourceFolder string `json:"resource_folder"`
RequirePacks bool `json:"require_packs"`
FetchPacksRemote bool `json:"fetch_packs_remote"`
}
type MovementOpts struct {
CorrectionThreshold float64 `json:"correction_threshold"`
}
var DefaultConfig = Config{
Version: ConfigVersion,
AuthKey: strings.Repeat("0", 64),
Branch: "stable",
LocalAddress: ":19132",
RemoteAddress: ":20000",
LoggingType: LoggingTypePerPlayer,
LogFile: "oomph.log",
ShutdownMessage: DefaultShutdownMessage,
Resource: ResourceOpts{
ResourceFolder: "resources/",
RequirePacks: true,
FetchPacksRemote: true,
},
Movement: MovementOpts{
CorrectionThreshold: 0.3,
},
Moderators: []string{},
}