X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=dded0e6451073153fea76fd1e77b8834e8cced9b;hb=8b0c842c51c3a51b45ff8c4940d6b5fad00cdde8;hp=7dc55189d6d4b349eccfb9dc1b8653a8952605c4;hpb=64b4171276c84a8df58776608dd9f568adef27b2;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 7dc55189..dded0e64 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -230,35 +230,7 @@ sub normal return if $pcno == 26; # send out the filtered spots - my @dxchan = get_all_ak1a(); - my $dxchan; - - # send it if it isn't the except list and isn't isolated and still has a hop count - # taking into account filtering and so on - foreach $dxchan (@dxchan) { - next if $dxchan == $self; - my $routeit; - my ($filter, $hops) = Filter::it($dxchan->{spotfilter}, @spot, $self->{call} ) if $dxchan->{spotfilter}; - if ($hops) { - $routeit = $line; - $routeit =~ s/\^H\d+\^\~$/\^H$hops\^\~/; - } else { - $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name - next unless $routeit; - } - if ($filter) { - $dxchan->send($routeit) if $routeit; - } else { - $dxchan->send($routeit) unless $dxchan->{isolate} || $self->{isolate}; - } - } - - # send orf to the users - if (@spot) { - my $buf = Spot::formatb($field[1], $field[2], $d, $text, $spotter); - broadcast_users("$buf\a\a", 'dx', $spot[0]); - } - + send_dx_spot($self, $line, @spot) if @spot; return; } @@ -711,6 +683,40 @@ sub finish # # some active measures # +sub send_dx_spot +{ + my $self = shift; + my $line = shift; + my @dxchan = DXChannel->get_all(); + my $dxchan; + + # send it if it isn't the except list and isn't isolated and still has a hop count + # taking into account filtering and so on + foreach $dxchan (@dxchan) { + my $routeit; + my ($filter, $hops) = Filter::it($dxchan->{spotfilter}, @_, $self->{call} ) if $dxchan->{spotfilter}; + if ($dxchan->is_ak1a) { + next if $dxchan == $self; + if ($hops) { + $routeit = $line; + $routeit =~ s/\^H\d+\^\~$/\^H$hops\^\~/; + } else { + $routeit = adjust_hops($dxchan, $line); # adjust its hop count by node name + next unless $routeit; + } + if ($filter) { + $dxchan->send($routeit) if $routeit; + } else { + $dxchan->send($routeit) unless $dxchan->{isolate} || $self->{isolate}; + + } + } elsif ($dxchan->is_user) { + my $buf = Spot::formatb($_[0], $_[1], $_[2], $_[3], $_[4]); + $buf .= "\a\a" if $dxchan->beep; + $dxchan->send($buf) if !$hops || ($hops && $filter); + } + } +} sub send_local_config { @@ -728,9 +734,10 @@ sub send_local_config # and are not themselves isolated, this to make sure that isolated nodes # don't appear outside of this node @nodes = DXNode::get_all(); - @nodes = grep { $_->dxchan != $self } @nodes; @nodes = grep { $_->{call} ne $main::mycall } @nodes; - @localnodes = grep { $_->dxchan->{call} eq $_->{call} && !$_->dxchan->{isolate} } @nodes if @nodes; + @nodes = grep { $_->dxchan != $self } @nodes if @nodes; + @nodes = grep { !$_->dxchan->{isolate} } @nodes if @nodes; + @localnodes = grep { $_->dxchan->{call} eq $_->{call} } @nodes if @nodes; unshift @localnodes, DXCluster->get_exact($main::mycall); @remotenodes = grep { $_->dxchan->{call} ne $_->{call} } @nodes if @nodes; }