added code for PC90
authorminima <minima>
Mon, 24 Jun 2002 09:53:30 +0000 (09:53 +0000)
committerminima <minima>
Mon, 24 Jun 2002 09:53:30 +0000 (09:53 +0000)
made set/badspotter non SSID dependant

Changes
perl/DXProt.pm
perl/DXProtout.pm

diff --git a/Changes b/Changes
index a610e5193bc70a5c28b299eb71eb18db49cb8633..800dc23df127bf57ad72f874a2af5ff98429b84b 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+24Jun02=======================================================================
+1. make set/badspotter non SSID sensitive. Set/badnode is left to be SSID
+sensitive. 
 19Jun02=======================================================================
 1. make set/badspotter and set/badnode apply to announces and talks as well
 as spots. 
index ba79e43e0419ffab6a528e62123ba5ae41886929..59cdcf96c7272b5034007869e722e00df64ea830 100644 (file)
@@ -356,7 +356,9 @@ sub normal
                        }
 
                        # if this is a 'bad spotter' user then ignore it
-                       if ($badspotter->in($from)) {
+                       my $nossid = $from;
+                       $nossid =~ s/-\d+$//;
+                       if ($badspotter->in($nossid)) {
                                dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
                                return;
                        }
@@ -420,7 +422,9 @@ sub normal
                        }
                        
                        # if this is a 'bad spotter' user then ignore it
-                       if ($badspotter->in($field[6])) {
+                       my $nossid = $field[6];
+                       $nossid =~ s/-\d+$//;
+                       if ($badspotter->in($nossid)) {
                                dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
                                return;
                        }
@@ -568,7 +572,9 @@ sub normal
                        }
 
                        # if this is a 'bad spotter' user then ignore it
-                       if ($badspotter->in($field[1])) {
+                       my $nossid = $field[1];
+                       $nossid =~ s/-\d+$//;
+                       if ($badspotter->in($nossid)) {
                                dbg("PCPROT: Bad Spotter, dropped") if isdbg('chanerr');
                                return;
                        }
@@ -1231,6 +1237,9 @@ sub normal
                        
                        return;
                }
+               if ($pcno == 90) {              # new style PC16,17,19,21
+                       return;
+               }
        }
         
        # if get here then rebroadcast the thing with its Hop count decremented (if
@@ -1272,8 +1281,12 @@ sub process
                next unless $dxchan->is_node();
                next if $dxchan == $main::me;
 
-               # send the pc50
-               $dxchan->send($pc50s) if $pc50s;
+               # send the pc50 or PC90
+               if ($pc50s && $dxchan->is_spider) {
+#                      $dxchan->send_route(\&pc90, 1, $main::me, 'T', @dxchan);
+               } else {
+                       $dxchan->send($pc50s) if $pc50s;
+               }
                
                # send a ping out on this channel
                if ($dxchan->{pingint} && $t >= $dxchan->{pingint} + $dxchan->{lastping}) {
@@ -1309,6 +1322,7 @@ sub process
 # some active measures
 #
 
+
 sub send_dx_spot
 {
        my $self = shift;
@@ -1573,6 +1587,7 @@ sub send_local_config
                        dbg("sent a null value") if isdbg('chanerr');
                }
        }
+#      $self->send_route(\&pc90, 1, $main::me, 'T', DXChannel::get_all());
 }
 
 #
@@ -1939,6 +1954,12 @@ sub route_pc50
        broadcast_route($self, \&pc50, 1, @_);
 }
 
+sub route_pc90
+{
+       my $self = shift;
+       broadcast_route($self, \&pc90, 1, @_);
+}
+
 sub in_filter_route
 {
        my $self = shift;
index a2b69a67a9f4dfbba796dfaa5c17e7dde67aa184..cacf60e0c756a67612452ab192bb07c50be157c6 100644 (file)
@@ -360,6 +360,37 @@ sub pc85
        return "PC85^$tonode^$fromnode^$call^$msg^~";
 }
 
+# spider route broadcast
+sub pc90
+{
+       my $node = shift;
+       my $sort = shift;
+       my @out;
+       my $dxchan;
+       my $n = @_;
+       
+       while (@_) {
+               my $str = sprintf "PC90^%s^%X^%s%d", $node->call, $main::systime, $sort, $n-1 ;
+               for (; @_ && length $str < 200;) {
+                       my $ref = shift;
+                       next if $ref == $main::me;
+                       my $call = $ref->call;
+                       my $flag = 0;
+                       $flag += 1 if $ref->here;
+                       $flag += 2 if $ref->conf;
+                       if ($ref->is_node) {
+                               my $ping = int($ref->pingave * 10);
+                               $str .= "^N$flag$call,$ping";
+                       } else {
+                               $str .= "^U$flag$call";
+                       }
+               }
+               $str .= sprintf "^%s^", get_hops(90);
+               push @out, $str;
+       }
+       return @out;
+}
+
 1;
 __END__