tcldrop-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tcldrop/CVS] tcldrop/modules dcc.tcl


From: Philip Moore
Subject: [Tcldrop/CVS] tcldrop/modules dcc.tcl
Date: Fri, 21 Nov 2003 23:49:14 -0500

CVSROOT:        /cvsroot/tcldrop
Module name:    tcldrop
Branch:         
Changes by:     Philip Moore <address@hidden>   03/11/21 23:49:11

Modified files:
        modules        : dcc.tcl 

Log message:
        Added .traffic dcc command.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/tcldrop/tcldrop/modules/dcc.tcl.diff?tr1=1.26&tr2=1.27&r1=text&r2=text

Patches:
Index: tcldrop/modules/dcc.tcl
diff -u tcldrop/modules/dcc.tcl:1.26 tcldrop/modules/dcc.tcl:1.27
--- tcldrop/modules/dcc.tcl:1.26        Fri Nov 21 23:34:56 2003
+++ tcldrop/modules/dcc.tcl     Fri Nov 21 23:49:09 2003
@@ -1,6 +1,6 @@
 # dcc.tcl --
 #
-# $Id: dcc.tcl,v 1.26 2003/11/22 04:34:56 fireegl Exp $
+# $Id: dcc.tcl,v 1.27 2003/11/22 04:49:09 fireegl Exp $
 #
 # Copyright (C) 2003 FireEgl (Philip Moore) <address@hidden>
 #
@@ -32,7 +32,7 @@
        # Provide the users module:
        variable version {0.2}
        package provide tcldrop::dcc $version
-       variable rcsid {$Id: dcc.tcl,v 1.26 2003/11/22 04:34:56 fireegl Exp $}
+       variable rcsid {$Id: dcc.tcl,v 1.27 2003/11/22 04:49:09 fireegl Exp $}
        #checkmodule console
        # Export all the commands that should be available to 3rd-party 
scripters:
        namespace export dcclist listen putdcc getchan setchan console echo 
strip idx2hand hand2idx link bots islinked putbot putallbots sock2idx idx2sock
@@ -809,6 +809,19 @@
                array unset idxinfo
                array set idxinfo $d
                putdcc $idx "[format {%-3.3s %-6.6s %-5.5s %-9.9s %-32.32s 
%-4.4s} $a $idxinfo(sock) $idxinfo(port) $idxinfo(handle) $idxinfo(hostname) 
$idxinfo(other)]"
+       }
+}
+
+bind dcc n traffic ::tcldrop::dcc::TRAFFIC
+proc ::tcldrop::dcc::TRAFFIC {handle idx text} {
+       putcmdlog "#$handle# traffic $text"
+       putdcc $idx {Traffic Since Last Restart}
+       putdcc $idx {==========================}
+       foreach info [traffic $text] {
+               putdcc $idx "[lindex $info 0]:"
+               # FixMe: Convert bytes to kbytes or mbytes (to make it look 
like Eggdrop does).
+               putdcc $idx "  out: [lindex $info 4] bytes ([lindex $info 3] 
bytes since last daily reset)"
+               putdcc $idx "   in: [lindex $info 2] bytes ([lindex $info 1] 
bytes since last daily reset)"
        }
 }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]