40 |
::tcldrop::SetDefault console-autosave 1 |
::tcldrop::SetDefault console-autosave 1 |
41 |
::tcldrop::SetDefault force-channel 0 |
::tcldrop::SetDefault force-channel 0 |
42 |
::tcldrop::SetDefault info-party 0 |
::tcldrop::SetDefault info-party 0 |
43 |
|
::tcldrop::SetDefault connect-timeout 27 |
44 |
|
::tcldrop::SetDefault ident-timeout 13 |
45 |
variable Levels |
variable Levels |
46 |
# Define the log levels, and the user-flags that are required to see logs sent to that level: |
# Define the log levels, and the user-flags that are required to see logs sent to that level: |
47 |
array set Levels { |
array set Levels { |
824 |
putdcc $idx "OS: $tcl_platform(os) $tcl_platform(osVersion)" |
putdcc $idx "OS: $tcl_platform(os) $tcl_platform(osVersion)" |
825 |
} |
} |
826 |
|
|
|
|
|
827 |
bind time - {* * * * *} ::tcldrop::dcc::AutoLinkBots |
bind time - {* * * * *} ::tcldrop::dcc::AutoLinkBots |
828 |
proc ::tcldrop::dcc::AutoLinkBots {minute hour day month year} { |
proc ::tcldrop::dcc::AutoLinkBots {minute hour day month year} { |
829 |
foreach b [userlist b] { |
foreach b [userlist b] { |
877 |
set botaddr [getuser $bot BOTADDR] |
set botaddr [getuser $bot BOTADDR] |
878 |
set host [lindex $botaddr 0] |
set host [lindex $botaddr 0] |
879 |
set port [lindex $botaddr 1] |
set port [lindex $botaddr 1] |
880 |
set fail [catch { connect $host $port -timeout 99 -myaddr ${::my-ip} -control ::tcldrop::dcc::Read -writable ::tcldrop::dcc::BOTWrite -errors ::tcldrop::dcc::BOTConnectErrors } idx] |
set fail [catch { connect $host $port -timeout ${::connect-timeout} -myaddr ${::my-ip} -control ::tcldrop::dcc::Read -writable ::tcldrop::dcc::BOTWrite -errors ::tcldrop::dcc::BOTConnectErrors } idx] |
881 |
if {!$fail} { |
if {!$fail} { |
882 |
::tcldrop::idx::ChInfo $idx [list handle $bot remote $host hostname $host port $port type FORK_BOT other {conn bot} timestamp [set timestamp [unixtime]]] |
::tcldrop::idx::ChInfo $idx [list handle $bot remote $host hostname $host port $port type FORK_BOT other {conn bot} timestamp [set timestamp [unixtime]]] |
883 |
#set TimerID [utimer 99 [list ::tcldrop::dcc::BOTConnectTimeout $idx]] |
#set TimerID [utimer 99 [list ::tcldrop::dcc::BOTConnectTimeout $idx]] |
884 |
} |
} |
885 |
if {!$fail} { return 1 } else { return 0 } |
if {!$fail} { return 1 } else { return 0 } |
886 |
} |
} |