my $long = $ref->long;
my $node = $ref->homenode;
my $latlong = DXBearing::lltos($lat, $long) if $lat && $long;
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 1, $name), $DXProt::me) if $name;
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 2, $qth), $DXProt::me) if $qth;
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $latlong), $DXProt::me) if $latlong;
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 4, $node), $DXProt::me) if $node;
+ if ($name) {
+ my $l = DXProt::pc41($call, 1, $name);
+ DXProt::eph_dup($l);
+ DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
+ }
+ if ($qth) {
+ my $l = DXProt::pc41($call, 2, $qth);
+ DXProt::eph_dup($l);
+ DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
+ }
+ if ($latlong) {
+ my $l = DXProt::pc41($call, 3, $latlong);
+ DXProt::eph_dup($l);
+ DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
+ }
+ if ($node) {
+ my $l = DXProt::pc41($call, 4, $node);
+ DXProt::eph_dup($l);
+ DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
+ }
}
}
$dxchan->here(1);
push @out, $self->msg('heres', $call);
if ($ref) {
- DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ;
+ my $s = DXProt::pc24($ref);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
$ref->here(1);
} elsif ($ref = Route::Node::get($call)) {
- DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ;
+ my $s = DXProt::pc24($ref);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
$ref->here(1);
} else {
$ref = Route::Node::get($call);
$line = uc $line;
$user->homenode($line);
$user->put();
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 4, $line), $DXProt::me);
+ my $s = DXProt::pc41($call, 4, $line);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
return (1, $self->msg('hnode', $line));
} else {
return (1, $self->msg('namee2', $call));
my ($lat, $long) = DXBearing::stoll($line);
$user->lat($lat);
$user->long($long);
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me);
+ my $s = DXProt::pc41($call, 3, $line);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
unless ($user->qra && DXBearing::is_qra($user->qra) ) {
my $qra = DXBearing::lltoqra($lat, $long);
$user->qra($qra);
if ($user) {
$user->name($line);
$user->put();
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 1, $line), $DXProt::me);
+ my $s = DXProt::pc41($call, 1, $line);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
return (1, $self->msg('name', $line));
} else {
return (1, $self->msg('namee2', $call));
$user->lat($lat);
$user->long($long);
my $s = DXBearing::lltos($lat, $long);
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $s), $DXProt::me);
+ my $l = DXProt::pc41($call, 3, $s);
+ DXProt::eph_dup($l);
+ DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
}
$user->put();
if ($user) {
$user->qth($line);
$user->put();
- DXProt::broadcast_all_ak1a(DXProt::pc41($call, 2, $line), $DXProt::me);
+ my $s = DXProt::pc41($call, 2, $line);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
return (1, $self->msg('qth', $line));
} else {
return (1, $self->msg('namee2', $call));
$dxchan->here(0);
push @out, $self->msg('hereu', $call);
if ($ref) {
- DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ;
+ my $s = DXProt::pc24($ref);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
$ref->here(0);
} elsif ($ref = Route::Node::get($call)) {
- DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me) ;
+ my $s = DXProt::pc24($ref);
+ DXProt::eph_dup($s);
+ DXProt::broadcast_all_ak1a($s, $DXProt::me) ;
$ref->here(0);
} else {
$ref = Route::Node::get($call);
use strict;
use vars qw($me $pc11_max_age $pc23_max_age
- $last_hour $last10 %emph %pings %rcmds
+ $last_hour $last10 %eph %pings %rcmds
%nodehops $baddx $badspotter $badnode $censorpc
$allowzero $decode_dk0wcy $send_opernam @checklist);
# REBROADCAST!!!!
#
- if (emph_dup($line)) {
+ if (eph_dup($line)) {
dbg('chan', "PCPROT: Ephemeral dup, dropped");
} else {
unless ($self->{isolate}) {
# every ten seconds
if ($t - $last10 >= 10) {
- # clean out emphemera
+ # clean out ephemera
- emph_clean();
+ eph_clean();
$last10 = $t;
}
broadcast_route($self, \&pc21, scalar @_, @_);
}
-sub emph_dup
+sub eph_dup
{
my $s = shift;
# chop the end off
$s =~ s/\^H\d\d?\^?~?@//;
- return 1 if exists $emph{$s};
- $emph{$s} = $main::systime;
+ return 1 if exists $eph{$s};
+ $eph{$s} = $main::systime;
return undef;
}
-sub emph_clean
+sub eph_clean
{
my ($key, $val);
- while (($key, $val) = each %emph) {
+ while (($key, $val) = each %eph) {
if ($main::systime - $val > 90) {
- delete $emph{$key};
+ delete $eph{$key};
}
}
}