source: trunk/plugins/admin_flood.tcl @ 1143

Revision 655, 1.7 KB checked in by james, 6 years ago (diff)

Tidied up snap plugin
Make flood tick fire every 30s not every minute, using timer not bind
Better logging etc

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1# bMotion: admin plugin file for flood mangement
2#
3# $Id$
4#
5
6###############################################################################
7# This is a bMotion plugin
8# Copyright (C) James Michael Seward 2000-2002
9#
10# This program is covered by the GPL, please refer the to LICENCE file in the
11# distribution; further information can be found in the headers of the scripts
12# in the modules directory.
13###############################################################################
14
15
16### management version
17
18proc bMotion_plugin_management_flood { handle { arg "" } } {
19  global bMotion_flood_info bMotion_flood_last bMotion_flood_lasttext bMotion_flood_undo
20
21  #flood show <handle>
22  if [regexp -nocase {show ([^ ]+)} $arg matches handle] {
23    bMotion_putadmin "bMotion: Flood for $handle is [bMotion_flood_get $handle]"
24                bMotion_putadmin "bMotion: flood: last text for $handle was $bMotion_flood_lasttext($handle)"
25                bMotion_putadmin "bMotion: flood: last callback for $handle was $bMotion_flood_last($handle)"
26    return 0
27  }
28
29  #flood set <handle> <n>
30  if [regexp -nocase {set ([^ ]+) (.+)} $arg matches handle value] {
31    set bMotion_flood_info($handle) $value
32    bMotion_putadmin "bMotion: flood for $handle set to 0"
33    return 0
34  }
35
36
37  #status
38  if [regexp -nocase {status} $arg] {
39    set handles [array names bMotion_flood_info]
40    bMotion_putadmin "bMotion: current flood info:"
41    foreach handle $handles {
42      bMotion_putadmin "$handle: [bMotion_flood_get $handle]"
43    }
44    return 0
45  }
46
47  #all else fails, list help
48  bMotion_putadmin "usage: flood \[show|set|status\]"
49  return 0
50}
51
52bMotion_plugin_add_management "flood" "^flood" n "bMotion_plugin_management_flood"
Note: See TracBrowser for help on using the repository browser.