[Sguil-cvs] sguil/server/lib SguildClientCmdRcvd.tcl,1.3,1.4
Status: Beta
Brought to you by:
bamm
From: Steve H. <sha...@us...> - 2004-10-18 20:49:51
|
Update of /cvsroot/sguil/sguil/server/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv526/server/lib Modified Files: SguildClientCmdRcvd.tcl Log Message: You can switch sensors in the GUI without restarting!! Yeah!! (look under the file menu) -srh Index: SguildClientCmdRcvd.tcl =================================================================== RCS file: /cvsroot/sguil/sguil/server/lib/SguildClientCmdRcvd.tcl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SguildClientCmdRcvd.tcl 18 Oct 2004 15:28:20 -0000 1.3 --- SguildClientCmdRcvd.tcl 18 Oct 2004 20:49:37 -0000 1.4 *************** *** 276,292 **** # now the client gets everything. # ! proc MonitorSensors { socketID sensorList } { ! global clientList clientMonitorSockets connectedAgents socketInfo sensorUsers ! LogMessage "$socketID added to clientList" ! lappend clientList $socketID ! foreach sensorName $sensorList { ! lappend clientMonitorSockets($sensorName) $socketID ! lappend sensorUsers($sensorName) [lindex $socketInfo($socketID) 2] ! } ! SendSystemInfoMsg sguild "User [lindex $socketInfo($socketID) 2] is monitoring sensors: $sensorList" ! SendCurrentEvents $socketID ! #if { [info exists connectedAgents] } { ! # SendSystemInfoMsg sguild "Connected sensors - $connectedAgents" ! #} } --- 276,312 ---- # now the client gets everything. # ! proc MonitorSensors { socketID ClientSensorList } { ! global clientList clientMonitorSockets connectedAgents socketInfo sensorUsers sensorList ! ! ! if {[lsearch -exact $clientList $socketID] < 0} { ! LogMessage "$socketID added to clientList" ! lappend clientList $socketID ! } ! # Find this socketID in other sensors and delete it ! foreach sensor $sensorList { ! if [info exists clientMonitorSockets($sensor)] { ! set index [lsearch $clientMonitorSockets($sensor) $socketID] ! if { $index > -1 } { ! set clientMonitorSockets($sensor) [lreplace clientMonitorSockets($sensor) $index $index] ! } ! } ! if [info exists sensorUsers($sensor)] { ! set index [lsearch $sensorUsers($sensor) [lindex $socketInfo($socketID) 2]] ! if { $index > -1 } { ! set sensorUsers($sensor) [lreplace sensorUsers($sensor) $index $index] ! } ! } ! } ! ! foreach sensorName $ClientSensorList { ! lappend clientMonitorSockets($sensorName) $socketID ! lappend sensorUsers($sensorName) [lindex $socketInfo($socketID) 2] ! } ! SendSystemInfoMsg sguild "User [lindex $socketInfo($socketID) 2] is monitoring sensors: $ClientSensorList" ! SendCurrentEvents $socketID ! #if { [info exists connectedAgents] } { ! # SendSystemInfoMsg sguild "Connected sensors - $connectedAgents" ! #} } |