X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=93baa8dae5759d60503ad7c6c967987141a35fa3;hb=080a66c38925314321249190eb5a4dc572636d4b;hp=0a1c83ddbce0278dbac19abfa5fc76d4678096c0;hpb=e83b70ecab022dbbeac0b56f67ed2e4bed609e86;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 0a1c83dd..93baa8da 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -34,7 +34,7 @@ use strict; use vars qw($me $pc11_max_age $pc23_max_age $last_hour %pings %rcmds %nodehops @baddx $baddxfn - $allowzero $decode_dk0wcy); + $allowzero $decode_dk0wcy $send_opernam); $me = undef; # the channel id for this cluster $pc11_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc11 @@ -247,7 +247,7 @@ sub normal my $user = DXUser->get_current($spot[4]); if ($user) { my $qra = $user->qra; - if (!DXBearing::is_qra) { + unless ($qra && DXBearing::is_qra($qra)) { my $lat = $user->lat; my $long = $user->long; if (defined $lat && defined $long) { @@ -255,6 +255,35 @@ sub normal $user->put; } } + + # send a remote command to a distant cluster if it is visible and there is no + # qra locator and we havn't done it for a month. + + unless ($user->qra) { + my $node; + my $to = $user->homenode; + my $last = $user->lastoper || 0; + if ($send_opernam && $main::systime > $last + $DXUser::lastoperinterval && $to && ($node = DXCluster->get_exact($to)) ) { + my $cmd = "forward/opernam $spot[4]"; + # send the rcmd but we aren't interested in the replies... + if ($node && $node->dxchan && $node->dxchan->is_clx) { + route(undef, $to, pc84($main::mycall, $to, $main::mycall, $cmd)); + } else { + route(undef, $to, pc34($main::mycall, $to, $cmd)); + } + if ($to ne $field[7]) { + $to = $field[7]; + $node = DXCluster->get_exact($to); + if ($node && $node->dxchan && $node->dxchan->is_clx) { + route(undef, $to, pc84($main::mycall, $to, $main::mycall, $cmd)); + } else { + route(undef, $to, pc34($main::mycall, $to, $cmd)); + } + } + $user->lastoper($main::systime); + $user->put; + } + } } # local processing @@ -669,10 +698,12 @@ sub normal $user->lat($lat); $user->long($long); my $qra = $user->qra || DXBearing::lltoqra($lat, $long); - $qra = DXBearing::lltoqra($lat, $long) unless DXBearing::is_qra($qra); + $qra = DXBearing::lltoqra($lat, $long) unless $qra && DXBearing::is_qra($qra); + $user->qra($qra) if $qra ne $user->qra; } elsif ($field[2] == 4) { $user->homenode($field[3]); } + $user->lastoper($main::systime); # to cut down on excessive for/opers being generated $user->put; last SWITCH; } @@ -770,7 +801,7 @@ sub normal my $ref = DXUser->get_current($field[2]); my $cref = DXCluster->get($field[2]); Log('rcmd', 'in', $ref->{priv}, $field[2], $field[4]); - unless ($field[3] =~ /rcmd/i || !$cref || !$ref || $cref->mynode->call ne $ref->homenode) { # not allowed to relay RCMDS! + unless ($field[4] =~ /rcmd/i || !$cref || !$ref || $cref->mynode->call ne $ref->homenode) { # not allowed to relay RCMDS! if ($ref->{priv}) { # you have to have SOME privilege, the commands have further filtering $self->{remotecmd} = 1; # for the benefit of any command that needs to know my $oldpriv = $self->{priv}; @@ -794,7 +825,7 @@ sub normal if ($ref && $ref->is_clx) { $self->route($field[1], $line); } else { - route($field[1], pc34($field[2], $field[1], $field[3])); + route($field[1], pc34($field[2], $field[1], $field[4])); } } return; @@ -818,7 +849,7 @@ sub normal if ($ref && $ref->is_clx) { $self->route($field[1], $line); } else { - route($field[1], pc35($field[2], $field[1], $field[3])); + route($field[1], pc35($field[2], $field[1], $field[4])); } } return; @@ -957,7 +988,7 @@ sub send_dx_spot $dxchan->send($routeit) unless $dxchan->{isolate} || $self->{isolate}; } } elsif ($dxchan->is_user && $dxchan->{dx}) { - my $buf = Spot::formatb($_[0], $_[1], $_[2], $_[3], $_[4]); + my $buf = Spot::formatb($dxchan->{user}->wantgrid, $_[0], $_[1], $_[2], $_[3], $_[4]); $buf .= "\a\a" if $dxchan->{beep}; if ($dxchan->{state} eq 'prompt' || $dxchan->{state} eq 'convers') { $dxchan->send($buf);