add all stats and tie stats to user rather than company

This commit is contained in:
shoopea
2021-12-09 21:42:44 +08:00
parent be1712b066
commit 4cecee1a0f
4 changed files with 616 additions and 258 deletions

View File

@@ -44,18 +44,18 @@ type ClientConfig struct {
}
type Config struct {
Server *ServerConfig `json:"server"`
Telegram *TelegramConfig `json:"telegram"`
Game *GameConfig `json:"game"`
Clients map[int]*ClientConfig `json:"clients"`
Stats map[uint8]map[string]*Stat `json:"stats"`
Server *ServerConfig `json:"server"`
Telegram *TelegramConfig `json:"telegram"`
Game *GameConfig `json:"game"`
Clients map[int]*ClientConfig `json:"clients"`
Stats map[int]map[string]*Stat `json:"stats"`
}
// Init values for a config based on package defaults
func (c *Config) Init() error {
err := json.Unmarshal(cfgSample, &c)
c.Clients = make(map[int]*ClientConfig)
c.Stats = make(map[uint8]map[string]*Stat)
c.Stats = make(map[int]map[string]*Stat)
if err != nil {
return err