Changeset 1069 for trunk/modules/flood.tcl
- Timestamp:
- 02/01/10 18:59:10 (2 years ago)
- File:
-
- 1 edited
-
trunk/modules/flood.tcl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/modules/flood.tcl
r939 r1069 82 82 83 83 set val 1 84 if [validuser $nick] { 85 set handle $nick 86 } else { 87 set handle [nick2hand $nick] 88 if {$handle == "*"} { 89 set handle $nick 90 } 91 } 84 if {[string index $nick 0] != "#"} { 85 if [validuser $nick] { 86 set handle $nick 87 } else { 88 set handle [nick2hand $nick] 89 if {$handle == "*"} { 90 set handle $nick 91 } 92 bMotion_putloglev d * "Using handle $handle as flood target (was $nick)" 93 } 94 } else { 95 bMotion_putloglev d * "Using channel $nick as flood target" 96 set handle $nick 97 } 92 98 set lastCallback "" 93 99 catch { … … 196 202 197 203 proc bMotion_flood_get { nick } { 198 global bMotion_flood_info 199 if [validuser $nick] { 200 set handle $nick 201 } else { 202 set handle [nick2hand $nick] 203 if {$handle == "*"} { 204 set handle $nick 205 } 206 } 207 set flood 0 208 catch { 204 global bMotion_flood_info 205 if {[string index $nick 0] != "#"} { 206 if [validuser $nick] { 207 set handle $nick 208 } else { 209 set handle [nick2hand $nick] 210 if {$handle == "*"} { 211 set handle $nick 212 } 213 } 214 } else { 215 set handle $nick 216 } 217 set flood 0 218 catch { 209 219 set flood $bMotion_flood_info($handle) 210 220 } … … 226 236 set flood [bMotion_flood_get $nick] 227 237 set chance 2 228 if {$flood > 35} { 229 set chance -1 230 } 231 232 if {$flood > 25} { 233 set chance -1 234 } 235 236 if {$flood > 15} { 237 set chance 1 238 } 239 set r [rand 2] 240 if {!($r < $chance)} { 241 putlog "bMotion: FLOOD check on $nick (http://www.bmotion.net:8000/bmotion/wiki/FAQDisableFlood)" 242 return 1 243 } 238 239 if {[string index $nick 0] == "#"} { 240 set is_chan 1 241 } else { 242 set is_chan 0 243 } 244 245 if {!$is_chan} { 246 if {$flood > 35} { 247 set chance -1 248 } 249 250 if {$flood > 25} { 251 set chance -1 252 } 253 254 if {$flood > 15} { 255 set chance 1 256 } 257 set r [rand 2] 258 if {!($r < $chance)} { 259 putlog "bMotion: FLOOD check on $nick (http://www.bmotion.net:8000/bmotion/wiki/FAQDisableFlood)" 260 return 1 261 } 262 } else { 263 if {$flood > 35} { 264 putlog "bMotion: FLOOD protection for $nick (http://www.bmotion.net:8000/bmotion/wiki/FAQDisableFlood)" 265 return 1 266 } 267 } 244 268 return 0 245 269 }
Note: See TracChangeset
for help on using the changeset viewer.
