X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FAranea.pm;h=75fcee8e07519bff04faa5d341f3ad24c62eb07a;hb=3026a0e22bc83be171bdd94cb2c1594e13c7a75f;hp=5dec124c42f708dcbd3ad75e31deec70f11d6afd;hpb=f4fd2e96d56ed980113fddfd969587681eb414cf;p=spider.git diff --git a/perl/Aranea.pm b/perl/Aranea.pm index 5dec124c..75fcee8e 100644 --- a/perl/Aranea.pm +++ b/perl/Aranea.pm @@ -126,7 +126,7 @@ sub start unless ($self->{outbound}) { my $thing = Thingy::Rt->new_cf; $thing->broadcast; - $self->lastcf($main::systime); + $main::me->lastcf($main::systime); } # run a script send the output to the debug file @@ -169,24 +169,42 @@ sub per_minute { # send hello and cf packages periodically foreach my $dxchan (DXChannel::get_all()) { - next if $dxchan == $main::me; next if $dxchan->is_aranea; if ($main::systime >= $dxchan->lasthello + $hello_interval) { - my $thing = Thingy::Hello->new(user => $dxchan->call, h => $dxchan->here); + my $thing = Thingy::Hello->new(h => $dxchan->here); + $thing->{user} = $dxchan->{call} unless $dxchan == $main::me; + if (my $v = $dxchan->{version}) { + if ($dxchan->is_spider) { + $thing->{sw} = 'DXSp'; + } + $thing->{v} = $v; + } + $thing->{b} = $dxchan->{build} if $dxchan->{build}; $thing->broadcast($dxchan); $dxchan->lasthello($main::systime); } if ($dxchan->is_node) { if ($main::systime >= $dxchan->lastcf + $cf_interval) { my $call = $dxchan->call; - my $thing = Thingy::Rt->new(user => $call); - if (my $nref = Route::Node::get($call)) { - $thing->copy_pc16_data($nref); - $thing->broadcast($dxchan); + if ($dxchan == $main::me) { + + # i am special but, currently, still a node + my $thing = Thingy::Rt->new_cf; + $thing->broadcast; $dxchan->lastcf($main::systime); } else { - dbg("Aranea::per_minute: Route::Node for $call disappeared"); - $dxchan->disconnect; + + # i am a pc protocol node connected directly + my $thing = Thingy::Rt->new(); + $thing->{user} = $call unless $dxchan == $main::me; + if (my $nref = Route::Node::get($call)) { + $thing->copy_pc16_data($nref); + $thing->broadcast($dxchan); + $dxchan->lastcf($main::systime); + } else { + dbg("Aranea::per_minute: Route::Node for $call disappeared"); + $dxchan->disconnect; + } } } }