Skip to content

Commit

Permalink
fix: 黑名单的使用时立即退出群配置无法正确持久化
Browse files Browse the repository at this point in the history
Fix #359
  • Loading branch information
Xiangze-Li committed Oct 20, 2023
1 parent fc13f3c commit d07b881
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dice/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,7 @@ func (d *Dice) loads() {
data, err := os.ReadFile(filepath.Join(d.BaseConfig.DataDir, "serve.yaml"))

// 配置这块弄得比较屎,有机会换个方案。。。
// TODO(Xiangze Li): 不管谁都好 赶紧重写吧, 谁能想起来加了配置还要在这里添一行才能Load出来哇
if err == nil { //nolint:nestif
dNew := Dice{}
err2 := yaml.Unmarshal(data, &dNew)
Expand Down Expand Up @@ -1743,6 +1744,8 @@ func (d *Dice) loads() {
d.BanList.BanBehaviorRefuseReply = dNew.BanList.BanBehaviorRefuseReply
d.BanList.BanBehaviorRefuseInvite = dNew.BanList.BanBehaviorRefuseInvite
d.BanList.BanBehaviorQuitLastPlace = dNew.BanList.BanBehaviorQuitLastPlace
d.BanList.BanBehaviorQuitPlaceImmediately = dNew.BanList.BanBehaviorQuitPlaceImmediately

d.BanList.ScoreReducePerMinute = dNew.BanList.ScoreReducePerMinute

d.BanList.ThresholdWarn = dNew.BanList.ThresholdWarn
Expand Down

0 comments on commit d07b881

Please sign in to comment.