|
@@ -111,23 +111,30 @@ proc ::cims::interconnect::send_from_bind {nick mask hand chan text} {
|
|
::cims::interconnect::send "$text"
|
|
::cims::interconnect::send "$text"
|
|
}
|
|
}
|
|
|
|
|
|
-proc ::cims::timeout_reply_from_ic_for_netbot {netbot network freqname source} {
|
|
|
|
|
|
+proc ::cims::interconnect::build_count_string {freqname source } {
|
|
set bcid $::cims::interconnect::sources($freqname,$source)
|
|
set bcid $::cims::interconnect::sources($freqname,$source)
|
|
-
|
|
|
|
if {[info exists ::cims::interconnect::receive_count($bcid)]} {
|
|
if {[info exists ::cims::interconnect::receive_count($bcid)]} {
|
|
set count_list $::cims::interconnect::receive_count($bcid)
|
|
set count_list $::cims::interconnect::receive_count($bcid)
|
|
|
|
|
|
- set output_for_netbot "And to "
|
|
|
|
|
|
+ set output_for_netbot "And to"
|
|
foreach {item count} $count_list {
|
|
foreach {item count} $count_list {
|
|
- set output_for_netbot "$output_for_netbot $count ${item}, "
|
|
|
|
|
|
+ set output_for_netbot "$output_for_netbot $count ${item},"
|
|
}
|
|
}
|
|
- set output_for_netbot "[string range $output_for_netbot 0 [expr [string length $output_for_netbot] - 2]"
|
|
|
|
|
|
+ set output_for_netbot "[string range $output_for_netbot 0 [expr [string length $output_for_netbot] - 2]]"
|
|
set output_for_netbot "${output_for_netbot}."
|
|
set output_for_netbot "${output_for_netbot}."
|
|
- putlog "w000000t: $output_for_netbot"
|
|
|
|
- # Give him a reply.
|
|
|
|
- ::cims::put_bot $netbot "mnet_interconnect_answer $network $freqname $source $output_for_netbot"
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
+ return $output_for_netbot
|
|
|
|
+ } else {
|
|
|
|
+ return ""
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+proc ::cims::timeout_reply_from_ic_for_netbot {netbot network freqname source} {
|
|
|
|
+
|
|
|
|
+ set output_for_netbot [::cims::interconnect::build_count_string $freqname $source]
|
|
|
|
+ if {"$output_for_netbot" != ""} {
|
|
|
|
+ ::cims::put_bot $netbot "mnet_interconnect_answer $network $freqname $source [list $output_for_netbot]"
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -223,10 +230,10 @@ proc ::cims::interconnect::add_up {bcid item count} {
|
|
# called right before the output...
|
|
# called right before the output...
|
|
proc ::cims::timeout_reply_from_local_for_netbots_plugin {freqname source} {
|
|
proc ::cims::timeout_reply_from_local_for_netbots_plugin {freqname source} {
|
|
upvar output output
|
|
upvar output output
|
|
- set bcid $::cims::interconnect::sources($freqname,$source)
|
|
|
|
|
|
|
|
- if {[info exists ::cims::interconnect::receive_count($bcid)]} {
|
|
|
|
- set output "$output $::cims::interconnect::receive_count($bcid)"
|
|
|
|
|
|
+ set add_output [::cims::interconnect::build_count_string $freqname $source]
|
|
|
|
+ if {"$add_output" != ""} {
|
|
|
|
+ set output "$output $add_output"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -248,7 +255,10 @@ proc ::cims::interconnect::work {inputline} {
|
|
# this tells us, we sent a REQ_BC before.
|
|
# this tells us, we sent a REQ_BC before.
|
|
|
|
|
|
set broadcasts($bcid) [list "$network" "$freqname" "$source"]
|
|
set broadcasts($bcid) [list "$network" "$freqname" "$source"]
|
|
|
|
+
|
|
|
|
+ # keep that last message from $freqname,$source valid for 15 seconds
|
|
set ::cims::interconnect::sources($freqname,$source) "$bcid"
|
|
set ::cims::interconnect::sources($freqname,$source) "$bcid"
|
|
|
|
+ utimer 15 "unset ::cims::interconnect::sources($freqname,$source)"
|
|
|
|
|
|
#putlog "bcid vars saved: $broadcasts($bcid) "
|
|
#putlog "bcid vars saved: $broadcasts($bcid) "
|
|
|
|
|
|
@@ -420,7 +430,7 @@ proc ::cims::message_from_netbot_to_plugin {netbot network freqname source nick
|
|
# receive answers from the other networks
|
|
# receive answers from the other networks
|
|
# in the meantime, we get all the BC_RE replies and counts.
|
|
# in the meantime, we get all the BC_RE replies and counts.
|
|
# Now, we should get that count and send it to originating netbot.
|
|
# Now, we should get that count and send it to originating netbot.
|
|
- utimer 5 "::cims::timeout_reply_from_ic_for_netbot $netbot $network $freqname $source"
|
|
|
|
|
|
+ utimer 5 "::cims::timeout_reply_from_ic_for_netbot $netbot $network $freqname [list $source]"
|
|
|
|
|
|
# send an own answer to the originating netbot
|
|
# send an own answer to the originating netbot
|
|
|
|
|