X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=3681bfbf35fee93b3c8fbbe96baf3bf716a1460a;hb=6a510dc82f3050640dfe6b8d499995348075fe7a;hp=411b33b456bf1986abf705386f68d1415cf57f75;hpb=579810d363939640538f88a9caa86e01fe9c7709;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 411b33b4..3681bfbf 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -208,7 +208,7 @@ sub new # add this node to the table, the values get filled in later my $pkg = shift; my $call = shift; - $main::routeroot->add($call, '0000', Route::here(1)) if $call ne $main::mycall; + $main::routeroot->add($call, '5000', Route::here(1)) if $call ne $main::mycall; return $self; } @@ -396,7 +396,7 @@ sub normal } # rsfp check - return if $rspfcheck and !$self->rspfcheck(1, $field[7], $field[6]); +# return if $rspfcheck and !$self->rspfcheck(1, $field[7], $field[6]); # if this is a 'nodx' node then ignore it if ($badnode->in($field[7])) { @@ -431,10 +431,6 @@ sub normal dbg("PCPROT: useless 'BUSTED' spot") if isdbg('chanerr'); return; } - if (Spot::dup($field[1], $field[2], $d, $field[5])) { - dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr'); - return; - } if ($censorpc) { my @bad; if (@bad = BadWords::check($field[5])) { @@ -453,6 +449,11 @@ sub normal } } + if (Spot::dup($field[1], $field[2], $d, $field[5])) { + dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr'); + return; + } + # add it Spot::add(@spot); @@ -528,14 +529,10 @@ sub normal if ($pcno == 12) { # announces - return if $rspfcheck and !$self->rspfcheck(1, $field[5], $field[1]); +# return if $rspfcheck and !$self->rspfcheck(1, $field[5], $field[1]); # announce duplicate checking $field[3] =~ s/^\s+//; # remove leading blanks - if (AnnTalk::dup($field[1], $field[2], $field[3])) { - dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr'); - return; - } if ($censorpc) { my @bad; @@ -696,9 +693,8 @@ sub normal # input filter if required return unless $self->in_filter_route($parent); - my @rout = $parent->del_user($uref); - - $self->route_pc17($parent, @rout) if @rout; + $parent->del_user($uref); + $self->route_pc17($parent, $uref); return; } @@ -743,11 +739,18 @@ sub normal eph_del_regex("^PC(?:21\^$call|17\^[^\^]+\^$call)"); # check for sane parameters - $ver = 5000 if $ver eq '0000'; +# $ver = 5000 if $ver eq '0000'; next if $ver < 5000; # only works with version 5 software next if length $call < 3; # min 3 letter callsigns next if $call eq $main::mycall; + # check that this PC19 isn't trying to alter the wrong dxchan + my $dxchan = DXChannel->get($call); + if ($dxchan && $dxchan != $self) { + dbg("PCPROT: PC19 from $self->{call} trying to alter wrong locally connected $call, ignored!") if isdbg('chanerr'); + return; + } + # update it if required my $r = Route::Node::get($call); my $flags = Route::here($here)|Route::conf($conf); @@ -838,8 +841,8 @@ sub normal my $node = Route::Node::get($call); if ($node) { - my $dxchan = $node->dxchan; - if ($dxchan && $dxchan ne $self) { + my $dxchan = DXChannel->get($call); + if ($dxchan && $dxchan != $self) { dbg("PCPROT: PC21 from $self->{call} trying to alter locally connected $call, ignored!") if isdbg('chanerr'); return; } @@ -1152,7 +1155,7 @@ sub normal return; } @field = map { unpad($_) } @field; - if (WCY::dup($d,@field[3..7])) { + if (WCY::dup($d)) { dbg("PCPROT: Dup WCY Spot ignored\n") if isdbg('chanerr'); return; } @@ -1161,7 +1164,7 @@ sub normal my $rep; eval { - $rep = Local::wwv($self, @field[1..12]); + $rep = Local::wcy($self, @field[1..12]); }; # dbg("Local::wcy error $@") if isdbg('local') if $@; return if $rep; @@ -1451,6 +1454,11 @@ sub send_announce } } + if (AnnTalk::dup($_[0], $_[1], $_[2])) { + dbg("PCPROT: Duplicate Announce ignored") if isdbg('chanerr'); + return; + } + Log('ann', $target, $_[0], $text); # send it if it isn't the except list and isn't isolated and still has a hop count @@ -1774,7 +1782,7 @@ sub talk $line =~ s/\^/\\5E/g; # remove any ^ characters $self->send(DXProt::pc10($from, $to, $via, $line, $origin)); - Log('talk', $self->call, $from, $via?$via:$main::mycall, $line) unless $origin && $origin ne $main::mycall; + Log('talk', $to, $from, $via?$via:$self->call, $line) unless $origin && $origin ne $main::mycall; } # send it if it isn't the except list and isn't isolated and still has a hop count