diff --git a/client.go b/client.go index 108a8f5..111a6f9 100644 --- a/client.go +++ b/client.go @@ -29,7 +29,10 @@ func loadClients() error { muxClients.Lock() for _, c := range clts { - cx := ChirpClient{} + cx := ChirpClient{ + Config: ChirpConfig{ + InterceptPillage: true, + }} copier.Copy(&cx, &c) cx.Active = false /* @@ -183,6 +186,9 @@ func getLockedClient(id int64, createMissing bool) (*ChirpClient, bool) { c := ChirpClient{ TGUserID64: id, Active: false, + Config: ChirpConfig{ + InterceptPillage: true, + }, } c.Mux.Lock() muxClients.RUnlock() diff --git a/def.go b/def.go index 368f0d0..c21a290 100644 --- a/def.go +++ b/def.go @@ -78,23 +78,28 @@ type MQClient struct { Queue amqp.Queue `json:"-"` } +type ChirpConfig struct { + InterceptPillage bool `json:"intercept_pillage"` +} + type ChirpClient struct { - HeartBeat time.Time `json:"heart_beat"` - Login string `json:"nickname"` - Build string `json:"build"` - Active bool `json:"active"` - TGUserID64 int64 `json:"tg_user_id"` - MQ MQClient `json:"mq"` - CWUserID64 int64 `json:"user_id"` - CWGuildID64 int64 `json:"guild_id"` - CWRole string `json:"role"` - CWState string `json:"state"` - CWClass string `json:"class"` - CWBusyUntil time.Time `json:"busy_until"` - CWLastUpdate time.Time `json:"last_update"` - GameIdle bool `json:"game_idle"` - BotIdle bool `json:"bot_idle"` - Mux sync.Mutex `json:"-"` + HeartBeat time.Time `json:"heart_beat"` + Login string `json:"nickname"` + Build string `json:"build"` + Active bool `json:"active"` + TGUserID64 int64 `json:"tg_user_id"` + MQ MQClient `json:"mq"` + CWUserID64 int64 `json:"user_id"` + CWGuildID64 int64 `json:"guild_id"` + CWRole string `json:"role"` + CWState string `json:"state"` + CWClass string `json:"class"` + CWBusyUntil time.Time `json:"busy_until"` + CWLastUpdate time.Time `json:"last_update"` + GameIdle bool `json:"game_idle"` + BotIdle bool `json:"bot_idle"` + Mux sync.Mutex `json:"-"` + Config *ChirpConfig `json:"config"` } type MQKeepAlive struct {