]> dxcluster.org Git - spider.git/commitdiff
added broadcast_all_ak1a so that local commands go to isolated clusters
authordjk <djk>
Fri, 30 Apr 1999 20:07:10 +0000 (20:07 +0000)
committerdjk <djk>
Fri, 30 Apr 1999 20:07:10 +0000 (20:07 +0000)
as well.

15 files changed:
cmd/dx.pl
cmd/forward/opername.pl
cmd/kill.pl
cmd/set/here.pl
cmd/set/homenode.pl
cmd/set/location.pl
cmd/set/name.pl
cmd/set/qra.pl
cmd/set/qth.pl
cmd/set/sys_location.pl
cmd/set/sys_qra.pl
cmd/unset/here.pl
cmd/wx.pl
perl/DXCommandmode.pm
perl/DXProt.pm

index 308371fd5129273944c1031e9cac83a2e9b5eabf..bda2979ec83ffefdb927612dea0c3f2f628b3081 100644 (file)
--- 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);
        }
 }
 
index df10d231303fb487ff12017d428884d7116908da..2da3d95b5f26f8b2d33c82ba8264db18ddce78b1 100644 (file)
@@ -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;
                }
        }
 }
index d3614c3632f4dd5e4e1ca40623ba23b8db54f5dc..82e229756f5bc20e9f07df99087537180413467c 100644 (file)
@@ -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";
index 52b1c67c36ebd2ca20aa5168eef561d4ea8d33cd..114533efa87b8b011d54efc33b992c7e12e704be 100644 (file)
@@ -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);
index d85c893229cecd36da68707a5b024231cc5c9677..f1e909ffe81412cea67ab365d8bfee522384361f 100644 (file)
@@ -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));
index 64f6eb890a5d91ecf4b2976fe8d4767a3a370788..a9be3e006d8bccef5b7d881ed59457096219ba19 100644 (file)
@@ -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);
index 30b1dc7184c5f22d51cea9a11c9c1d44daf55b6a..e966837d9f3324dd23a4b84d1a92032198d3b7d9 100644 (file)
@@ -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));
index a60415c351c6b5e642b8e591dc688880e1d75407..1bdc1cecce5adfe3cf535129f41982a032e50750 100644 (file)
@@ -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();
index 90d784e14ffc9cf936eb56574068826911b4a10d..e76e5fffbdd4ae7d70a770d1a9681272809aaf90 100644 (file)
@@ -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));
index 3202a52181af2637830f2c2eded8d5852d3da1d4..903a5796526e7173074aabae7ed31b1495d8889c 100644 (file)
@@ -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);
index c19f6f71d3569f538220b9c6a15decbf46bd61f1..0deb1b20c83fc4cdd24eecf861a553610e1c5a43 100644 (file)
@@ -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();
index 7e2991528551ef96c05a1fa2ca0373349481ff63..6bc62ae9740bd00deebfa96a9e6aadb508d6068a 100644 (file)
@@ -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);
index 94db5d83ae32f62ccc34c3b768916b5bbb71a81a..cec70f4e484132fddaddf72a61af9728f099fc94 100644 (file)
--- 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, ());
index f9981349cb0e1b4d1766f4f72a489782776f3a02..331ca00e0d51b08042e36f05014a478f0b7829b0 100644 (file)
@@ -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;
index fbc63bc09ed2df2a5c2304ecf627ca86a0851be7..7dc55189d6d4b349eccfb9dc1b8653a8952605c4 100644 (file)
@@ -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