X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=d1ac6cf8218cb54ac39330935141eeaf5b1fe512;hb=e21257f7fb3b92795787575094e69a7cd804ce55;hp=b0d21db377ee62d8d7c847cfbc1dd4d1b4c0debc;hpb=a3fd9341b7ce57dcc058b82cfba3f40f15631241;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index b0d21db3..d1ac6cf8 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -27,7 +27,9 @@ use Local; use Carp; use strict; -use vars qw($me $pc11_max_age $pc11_dup_age $pc23_dup_age %spotdup %wwvdup $last_hour %pings %rcmds %nodehops); +use vars qw($me $pc11_max_age $pc11_dup_age $pc23_dup_age + %spotdup %wwvdup $last_hour %pings %rcmds + %nodehops @baddx $baddxfn); $me = undef; # the channel id for this cluster $pc11_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc11 @@ -39,7 +41,9 @@ $last_hour = time; # last time I did an hourly periodic update %pings = (); # outstanding ping requests outbound %rcmds = (); # outstanding rcmd requests outbound %nodehops = (); # node specific hop control +@baddx = (); # list of illegal spotted callsigns +$baddxfn = "$main::data/baddx.pl"; sub init { @@ -69,6 +73,9 @@ sub init $wwvdup{$dupkey} = $_->[1]; } + # load the baddx file + do "$baddxfn" if -e "$baddxfn"; + print "$@\n" if $@; } # @@ -189,8 +196,21 @@ sub normal } $spotdup{$dupkey} = $d; + + # is it 'baddx' + if (grep $field[2] eq $_, @baddx) { + dbg('chan', "Bad DX spot, ignored"); + return; + } - my $spot = Spot::add($freq, $field[2], $d, $text, $spotter, $field[7]); + my @spot = Spot::add($freq, $field[2], $d, $text, $spotter, $field[7]); + + # + # @spot at this point contains:- + # freq, spotted call, time, text, spotter, spotted cc, spotters cc, + # orig node, spotted itu, spotted cq, spotters itu, spotters cq + # you should be able to route on any of these + # # local processing my $r; @@ -201,9 +221,9 @@ sub normal return if $r; # send orf to the users - if ($spot && $pcno == 11) { + if (@spot && $pcno == 11) { my $buf = Spot::formatb($field[1], $field[2], $d, $text, $spotter); - broadcast_users("$buf\a\a", 'dx', $spot); + broadcast_users("$buf\a\a", 'dx', $spot[0]); } # DON'T be silly and send on PC26s! @@ -271,7 +291,7 @@ sub normal for ($i = 2; $i < $#field; $i++) { my ($call, $confmode, $here) = $field[$i] =~ /^(\S+) (\S) (\d)/o; - next if length $call < 3 || length $call > 8; + next if !$call || length $call < 3 || length $call > 8; next if !$confmode; $call = uc $call; next if DXCluster->get_exact($call); # we already have this (loop?) @@ -672,8 +692,10 @@ sub send_local_config @nodes = (DXCluster->get_exact($main::mycall)); } else { # create a list of all the nodes that are not connected to this connection - @nodes = DXNode::get_all(); - @nodes = grep { $_->dxchan != $self } @nodes; + # 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 && !$_->dxchan->{isolate} } @nodes; } my @s = $me->pc19(@nodes);