View Single Post
Old 11-02-2003, 06:06 PM  
darkone
Disabled
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

I decided to use the second implementation as it's easier to parse & has less overhead (only data you request, is being copied)

if { [client who init "UID" "VIRTUALPATH"] == 0 } {
while { 1 } {
set data [client who fetch]
if { "$data" == "" } {
break
}
iputs "Uid: [lindex $data 0] Path: [lindex $data 1]"
}
}


SITE KILL is something simple as:

set uid [resolve user $args]
if { $uid == -1 } {
iputs "Could not locate user"
return 0
}
# We should check for master flag!
if { [client who init "UID" "CID"] == 0 } {
while { 1 } {
set data [client who fetch]
if { "$data" == "" } {
break
}
if {[lindex $data 0] == $uid]} {
client kill clientid [lindex $data 1]
iptus "Gave death signal to client [lindex $data 1]"
}
iputs "Uid: [lindex $data 0] Path: [lindex $data 1]"
}
}
darkone is offline