diff --git a/connfilter.go b/connfilter.go index 42fe996..bc648db 100644 --- a/connfilter.go +++ b/connfilter.go @@ -160,36 +160,38 @@ where g.game_time < 60000 and g.time_started + $1::interval > now() and (i.pkey } // stage 7 ip based mute - ipmutes := map[string]bool{} - for i := len(inst.cfgs) - 1; i >= 0; i-- { - o, ok := inst.cfgs[i].GetKeys("ipmute") - if !ok { - continue - } - for _, k := range o { - s, ok := inst.cfgs[i].GetBool("ipmute", k) + if account == nil { + ipmutes := map[string]bool{} + for i := len(inst.cfgs) - 1; i >= 0; i-- { + o, ok := inst.cfgs[i].GetKeys("ipmute") if !ok { continue } - if !s { - delete(ipmutes, k) - } else { - ipmutes[k] = s + for _, k := range o { + s, ok := inst.cfgs[i].GetBool("ipmute", k) + if !ok { + continue + } + if !s { + delete(ipmutes, k) + } else { + ipmutes[k] = s + } } } - } - for kip, v := range ipmutes { - if !v { - continue - } - reg, err := regexp.Compile(kip) - if err != nil { - inst.logger.Printf("Failed to compile regexp %q: %s", kip, err.Error()) - continue - } - if reg.Match([]byte(ip)) { - if jd.AllowChat { - jd.AllowChat = false + for kip, v := range ipmutes { + if !v { + continue + } + reg, err := regexp.Compile(kip) + if err != nil { + inst.logger.Printf("Failed to compile regexp %q: %s", kip, err.Error()) + continue + } + if reg.Match([]byte(ip)) { + if jd.AllowChat { + jd.AllowChat = false + } } } }