X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=8437ff78ee313ae95816e49f0af0333b4f15c66f;hb=7cf8fad46075f1ca2b8b30475a26a881c031a0ad;hp=750b88839cfe7feb9554531aa47808b2eead30f8;hpb=148f4d43135748ba5aff985c50720b370ca1e336;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 750b8883..8437ff78 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -38,7 +38,7 @@ use strict; use vars qw($VERSION $BRANCH); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); -$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ ) || 0; +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); $main::build += $VERSION; $main::branch += $BRANCH; @@ -471,7 +471,7 @@ sub normal # this goes after the input filtering, but before the add # so that if it is input filtered, it isn't added to the dup # list. This allows it to come in from a "legitimate" source - if (Spot::dup($field[1], $field[2], $d, $field[5])) { + if (Spot::dup($field[1], $field[2], $d, $field[5], $field[6])) { dbg("PCPROT: Duplicate Spot ignored\n") if isdbg('chanerr'); return; } @@ -1078,7 +1078,7 @@ sub normal # add this station to the user database, if required my $user = DXUser->get_current($call); - $user = DXUser->new($call) if !$user; + $user = DXUser->new($call) unless $user; if ($field[2] == 1) { $user->name($field[3]); @@ -1498,24 +1498,27 @@ sub send_announce # obtain country codes etc my ($ann_dxcc, $ann_itu, $ann_cq, $org_dxcc, $org_itu, $org_cq) = (0..0); + my ($ann_state, $org_state) = ("", ""); my @dxcc = Prefix::extract($_[0]); if (@dxcc > 0) { $ann_dxcc = $dxcc[1]->dxcc; $ann_itu = $dxcc[1]->itu; $ann_cq = $dxcc[1]->cq; + $ann_state = $dxcc[1]->state; } @dxcc = Prefix::extract($_[4]); if (@dxcc > 0) { $org_dxcc = $dxcc[1]->dxcc; $org_itu = $dxcc[1]->itu; $org_cq = $dxcc[1]->cq; + $org_state = $dxcc[1]->state; } if ($self->{inannfilter}) { my ($filter, $hops) = $self->{inannfilter}->it(@_, $self->{call}, $ann_dxcc, $ann_itu, $ann_cq, - $org_dxcc, $org_itu, $org_cq); + $org_dxcc, $org_itu, $org_cq, $ann_state, $org_state); unless ($filter) { dbg("PCPROT: Rejected by input announce filter") if isdbg('chanerr'); return; @@ -1875,7 +1878,7 @@ sub send_route if (!$self->{isolate} && $self->{routefilter}) { $filter = undef; if ($r) { - ($filter, $hops) = $self->{routefilter}->it($self->{call}, $self->{dxcc}, $self->{itu}, $self->{cq}, $r->call, $r->dxcc, $r->itu, $r->cq); + ($filter, $hops) = $self->{routefilter}->it($self->{call}, $self->{dxcc}, $self->{itu}, $self->{cq}, $r->call, $r->dxcc, $r->itu, $r->cq, $self->{state}, $r->{state}); if ($filter) { push @rin, $r; } else { @@ -1914,6 +1917,8 @@ sub broadcast_route foreach $dxchan (@dxchan) { next if $dxchan == $self; next if $dxchan == $main::me; + next if $dxchan->user->wantnp; + $dxchan->send_route($generate, @_); } } @@ -1974,7 +1979,7 @@ sub in_filter_route my ($filter, $hops) = (1, 1); if ($self->{inroutefilter}) { - ($filter, $hops) = $self->{inroutefilter}->it($self->{call}, $self->{dxcc}, $self->{itu}, $self->{cq}, $r->call, $r->dxcc, $r->itu, $r->cq); + ($filter, $hops) = $self->{inroutefilter}->it($self->{call}, $self->{dxcc}, $self->{itu}, $self->{cq}, $r->call, $r->dxcc, $r->itu, $r->cq, $self->state, $r->state); dbg("PCPROT: $self->{call}/" . $r->call . ' rejected by in_filter_route') if !$filter && isdbg('chanerr'); } return $filter;