From 64b4171276c84a8df58776608dd9f568adef27b2 Mon Sep 17 00:00:00 2001 From: djk Date: Fri, 30 Apr 1999 20:07:10 +0000 Subject: [PATCH] added broadcast_all_ak1a so that local commands go to isolated clusters as well. --- cmd/dx.pl | 2 +- cmd/forward/opername.pl | 8 ++++---- cmd/kill.pl | 2 +- cmd/set/here.pl | 2 +- cmd/set/homenode.pl | 2 +- cmd/set/location.pl | 2 +- cmd/set/name.pl | 2 +- cmd/set/qra.pl | 2 +- cmd/set/qth.pl | 2 +- cmd/set/sys_location.pl | 2 +- cmd/set/sys_qra.pl | 2 +- cmd/unset/here.pl | 2 +- cmd/wx.pl | 2 +- perl/DXCommandmode.pm | 6 ++++-- perl/DXProt.pm | 20 +++++++++++++++++++- 15 files changed, 39 insertions(+), 19 deletions(-) diff --git a/cmd/dx.pl b/cmd/dx.pl index 308371fd..bda2979e 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -91,7 +91,7 @@ if (grep $_ eq $spotted, @DXProt::baddx) { DXProt::broadcast_users($buf, 'dx', \@spot); # send it orf to the cluster (hang onto your tin helmets) - DXProt::broadcast_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line)); + DXProt::broadcast_all_ak1a(DXProt::pc11($spotter, $freq, $spotted, $line), $DXProt::me); } } diff --git a/cmd/forward/opername.pl b/cmd/forward/opername.pl index df10d231..2da3d95b 100644 --- a/cmd/forward/opername.pl +++ b/cmd/forward/opername.pl @@ -23,10 +23,10 @@ if (@f == 0) { my $long = $ref->long; my $node = $ref->homenode; my $latlong = DXBearing::lltos($lat, $long) if $lat && $long; - DXProt::broadcast_ak1a(DXProt::pc41($call, 1, $name), $DXProt::me) if $name; - DXProt::broadcast_ak1a(DXProt::pc41($call, 2, $qth), $DXProt::me) if $qth; - DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $latlong), $DXProt::me) if $latlong; - DXProt::broadcast_ak1a(DXProt::pc41($call, 4, $node), $DXProt::me) if $node; + 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; } } } diff --git a/cmd/kill.pl b/cmd/kill.pl index d3614c36..82e22975 100644 --- a/cmd/kill.pl +++ b/cmd/kill.pl @@ -37,7 +37,7 @@ for $msgno (@f) { } Log('msg', "Message $ref->{msgno} from $ref->{from} to $ref->{to} deleted by $call"); if ($full) { - DXProt::broadcast_ak1a(DXProt::pc49($self->call, $ref->{subject}), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc49($self->call, $ref->{subject}), $DXProt::me); } $ref->del_msg; push @out, "Message $msgno deleted"; diff --git a/cmd/set/here.pl b/cmd/set/here.pl index 52b1c67c..114533ef 100644 --- a/cmd/set/here.pl +++ b/cmd/set/here.pl @@ -20,7 +20,7 @@ foreach $call (@args) { if ($dxchan && $ref) { $dxchan->here(1); $ref->here(1); - DXProt::broadcast_ak1a(DXProt::pc24($ref)); + DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me); push @out, $self->msg('heres', $call); } else { push @out, $self->msg('e3', "Set Here", $call); diff --git a/cmd/set/homenode.pl b/cmd/set/homenode.pl index d85c8932..f1e909ff 100644 --- a/cmd/set/homenode.pl +++ b/cmd/set/homenode.pl @@ -21,7 +21,7 @@ if ($user) { $line = uc $line; $user->homenode($line); $user->put(); - DXProt::broadcast_ak1a(DXProt::pc41($call, 4, $line), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 4, $line), $DXProt::me); return (1, $self->msg('hnode', $line)); } else { return (1, $self->msg('namee2', $call)); diff --git a/cmd/set/location.pl b/cmd/set/location.pl index 64f6eb89..a9be3e00 100644 --- a/cmd/set/location.pl +++ b/cmd/set/location.pl @@ -23,7 +23,7 @@ if ($user) { my ($lat, $long) = DXBearing::stoll($line); $user->lat($lat); $user->long($long); - DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me); if (!$user->qra) { my $qra = DXBearing::lltos($lat, $long); $user->qra($qra); diff --git a/cmd/set/name.pl b/cmd/set/name.pl index 30b1dc71..e966837d 100644 --- a/cmd/set/name.pl +++ b/cmd/set/name.pl @@ -20,7 +20,7 @@ $user = DXUser->get_current($call); if ($user) { $user->name($line); $user->put(); - DXProt::broadcast_ak1a(DXProt::pc41($call, 1, $line), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 1, $line), $DXProt::me); return (1, $self->msg('name', $line)); } else { return (1, $self->msg('namee2', $call)); diff --git a/cmd/set/qra.pl b/cmd/set/qra.pl index a60415c3..1bdc1cec 100644 --- a/cmd/set/qra.pl +++ b/cmd/set/qra.pl @@ -26,7 +26,7 @@ if ($user) { $user->lat($lat); $user->long($long); my $s = DXBearing::lltos($lat, $long); - DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $s), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $s), $DXProt::me); } $user->put(); diff --git a/cmd/set/qth.pl b/cmd/set/qth.pl index 90d784e1..e76e5fff 100644 --- a/cmd/set/qth.pl +++ b/cmd/set/qth.pl @@ -20,7 +20,7 @@ $user = DXUser->get_current($call); if ($user) { $user->qth($line); $user->put(); - DXProt::broadcast_ak1a(DXProt::pc41($call, 2, $line), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 2, $line), $DXProt::me); return (1, $self->msg('qth', $line)); } else { return (1, $self->msg('namee2', $call)); diff --git a/cmd/set/sys_location.pl b/cmd/set/sys_location.pl index 3202a521..903a5796 100644 --- a/cmd/set/sys_location.pl +++ b/cmd/set/sys_location.pl @@ -25,7 +25,7 @@ if ($user) { my ($lat, $long) = DXBearing::stoll($line); $user->lat($lat); $user->long($long); - DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $line), $DXProt::me); if (!$user->qra) { my $qra = DXBearing::lltos($lat, $long); $user->qra($qra); diff --git a/cmd/set/sys_qra.pl b/cmd/set/sys_qra.pl index c19f6f71..0deb1b20 100644 --- a/cmd/set/sys_qra.pl +++ b/cmd/set/sys_qra.pl @@ -28,7 +28,7 @@ if ($user) { $user->lat($lat); $user->long($long); my $s = DXBearing::lltos($lat, $long); - DXProt::broadcast_ak1a(DXProt::pc41($call, 3, $s), $DXProt::me); + DXProt::broadcast_all_ak1a(DXProt::pc41($call, 3, $s), $DXProt::me); } $user->put(); diff --git a/cmd/unset/here.pl b/cmd/unset/here.pl index 7e299152..6bc62ae9 100644 --- a/cmd/unset/here.pl +++ b/cmd/unset/here.pl @@ -20,7 +20,7 @@ foreach $call (@args) { if ($dxchan && $ref) { $dxchan->here(0); $ref->here(0); - DXProt::broadcast_ak1a(DXProt::pc24($ref)); + DXProt::broadcast_all_ak1a(DXProt::pc24($ref), $DXProt::me); push @out, $self->msg('hereu', $call); } else { push @out, $self->msg('e3', "Unset Here", $call); diff --git a/cmd/wx.pl b/cmd/wx.pl index 94db5d83..cec70f4e 100644 --- a/cmd/wx.pl +++ b/cmd/wx.pl @@ -40,7 +40,7 @@ DXProt::broadcast_list("WX de $from <$t>: $line", 'wx', undef, @locals); if ($to ne "LOCAL") { $line =~ s/\^//og; # remove ^ characters! my $pc = DXProt::pc12($from, $line, $tonode, $sysopflag, 1); - DXProt::broadcast_ak1a($pc); + DXProt::broadcast_ak1a($pc, $DXProt::me); } return (1, ()); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index f9981349..331ca00e 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -77,7 +77,9 @@ sub start # issue a pc16 to everybody interested my $nchan = DXChannel->get($main::mycall); my @pc16 = DXProt::pc16($nchan, $cuser); - DXProt::broadcast_ak1a(@pc16); + for (@pc16) { + DXProt::broadcast_all_ak1a($_); + } Log('DXCommand', "$call connected"); # send prompts and things @@ -304,7 +306,7 @@ sub finish # issue a pc17 to everybody interested my $nchan = DXChannel->get($main::mycall); my $pc17 = $nchan->pc17($self); - DXProt::broadcast_ak1a($pc17); + DXProt::broadcast_all_ak1a($pc17); Log('DXCommand', "$call disconnected"); $ref->del() if $ref; diff --git a/perl/DXProt.pm b/perl/DXProt.pm index fbc63bc0..7dc55189 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -773,7 +773,8 @@ sub route } } -# broadcast a message to all clusters [except those mentioned after buffer] +# broadcast a message to all clusters taking into account isolation +# [except those mentioned after buffer] sub broadcast_ak1a { my $s = shift; # the line to be rebroadcast @@ -789,6 +790,23 @@ sub broadcast_ak1a } } +# broadcast a message to all clusters ignoring isolation +# [except those mentioned after buffer] +sub broadcast_all_ak1a +{ + my $s = shift; # the line to be rebroadcast + my @except = @_; # to all channels EXCEPT these (dxchannel refs) + my @dxchan = get_all_ak1a(); + my $dxchan; + + # send it if it isn't the except list and isn't isolated and still has a hop count + foreach $dxchan (@dxchan) { + next if grep $dxchan == $_, @except; + my $routeit = adjust_hops($dxchan, $s); # adjust its hop count by node name + $dxchan->send($routeit); + } +} + # broadcast to all users # storing the spot or whatever until it is in a state to receive it sub broadcast_users -- 2.43.0