]> dxcluster.org Git - spider.git/commitdiff
added user filtering (or at leats the capability for it)
authordjk <djk>
Sun, 2 May 1999 14:49:10 +0000 (14:49 +0000)
committerdjk <djk>
Sun, 2 May 1999 14:49:10 +0000 (14:49 +0000)
fixed isolation problem

Changes
cmd/dx.pl
perl/DXProt.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index cbed32397d2d0497c6ba2530d1cefec11b340c62..7d23e07cb7a71a52c902791c36f320aa40054745 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+02May99=======================================================================
+1. Added the mechanism for doing user spot filtering for spots in the cluster 
+(no user control just yet - but sysops can do it).
+2. Fixed problem with nodes sending out the node lists of isolated nodes.
 30Apr99=======================================================================
 1. Try to make it even more AK1A friendly by putting the node list out in the
 'correct' order.
index bda2979ec83ffefdb927612dea0c3f2f628b3081..dd780699b62e6225727aa771f064e448dc1a3ca8 100644 (file)
--- a/cmd/dx.pl
+++ b/cmd/dx.pl
@@ -87,11 +87,13 @@ if (grep $_ eq $spotted, @DXProt::baddx) {
        my @spot = Spot::add($freq, $spotted, $main::systime, $line, $spotter, $main::mycall);
        if (@spot) {
                # send orf to the users
-               my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter);
-               DXProt::broadcast_users($buf, 'dx', \@spot);
+               DXProt::send_dx_spot($self, DXProt::pc11($spotter, $freq, $spotted, $line), @spot);
+               
+#              my $buf = Spot::formatb($freq, $spotted, $main::systime, $line, $spotter);
+#              DXProt::broadcast_users("$buf\a\a", 'dx', $spot[0]);
 
                # send it orf to the cluster (hang onto your tin helmets) 
-               DXProt::broadcast_all_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line), $DXProt::me);
+#              DXProt::broadcast_all_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line), $DXProt::me);
        }
 }
 
index 7dc55189d6d4b349eccfb9dc1b8653a8952605c4..b446b713f3e705994c1516995ff21583335425c3 100644 (file)
@@ -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);
+               }                                       
+       }
+}
 
 sub send_local_config
 {
@@ -728,9 +734,9 @@ 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 { $_->dxchan != $self && !$_->dxchan->{isolate} } @nodes;
                @nodes = grep { $_->{call} ne $main::mycall } @nodes;
-               @localnodes = grep { $_->dxchan->{call} eq $_->{call} && !$_->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;
        }
index 88131b21a6931b08583b7cf0df5e760c5d4024ee..ebe7ce0a51f9967ea56e58eeae5e9684fedeb986 100755 (executable)
@@ -67,7 +67,7 @@ package main;
 
 @inqueue = ();                                 # the main input queue, an array of hashes
 $systime = 0;                                  # the time now (in seconds)
-$version = "1.26";                             # the version no of the software
+$version = "1.27";                             # the version no of the software
 $starttime = 0;                 # the starting time of the cluster   
 $lockfn = "cluster.lock";       # lock file name