made ssids unique everywhere
authordjk <djk>
Wed, 24 Nov 1999 18:37:27 +0000 (18:37 +0000)
committerdjk <djk>
Wed, 24 Nov 1999 18:37:27 +0000 (18:37 +0000)
16 files changed:
Changes
cmd/set/isolate.pl
cmd/set/node.pl
cmd/set/obscount.pl
cmd/set/pinginterval.pl
cmd/set/privilege.pl
cmd/set/spider.pl [new file with mode: 0644]
cmd/spoof.pl
cmd/talk.pl
cmd/unset/isolate.pl
cmd/unset/node.pl
msg/swop.pl.issue
perl/DXCommandmode.pm
perl/DXProt.pm
perl/Messages
perl/cluster.pl

diff --git a/Changes b/Changes
index 37ea213d636636ac8feeb0f941a7f3db6948e27d..acbf476b1aa614bd6f612e2d45d68044c8f0c600 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,14 @@
+24Nov99=======================================================================
+1. extended badmsg.pl stuff so that it works like the forward file and allows
+one to reject on to, from, origin and subject fields.
+2. added a swop.pl again in a forward.pl like format that allows simple swop
+for a field or test on a field and set another.
+3. Fixed the problem that read private mail follows you around as well as
+unread private mail does.
+4. Change the logic of connections so that the node will accept callsigns with
+SSIDs to -8 as different entities from each other. SSIDs > 8 are subtracted 
+from 15 and are assumed to be coming in via netrom diddled connections. This
+affects lots of the commands as well. I may not have got them all.
 21Nov99=======================================================================
 1. lose extraneous rubbish after the callsign as sent by BBSes.
 2. Change end label on sh/moon to RGain dB rather than Loss dB.
index b008a9b0bfec2dd99948630de47b1094a6de443a..34fe22a349a63a3c2e7945fb6dc0ab44cec0f52c 100644 (file)
@@ -15,24 +15,24 @@ my @out;
 my $user;
 my $create;
 
-return (0) if $self->priv < 9;
+return (1, $self->msg('e5')) if $self->priv < 9;
 
 foreach $call (@args) {
-  $call = uc $call;
-  my $chan = DXChannel->get($call);
-  if ($chan) {
-       push @out, $self->msg('nodee1', $call);
-  } else {
-    $user = DXUser->get($call);
-       $create = !$user;
-       $user = DXUser->new($call) if $create;
-       if ($user) {
-         $user->isolate(1);
-         $user->close();
-      push @out, $self->msg($create ? 'isoc' : 'iso', $call);
+       $call = uc $call;
+       my $chan = DXChannel->get($call);
+       if ($chan) {
+               push @out, $self->msg('nodee1', $call);
        } else {
-      push @out, $self->msg('e3', "Set/Isolate", $call);
+               $user = DXUser->get_exact($call);
+               $create = !$user;
+               $user = DXUser->new($call) if $create;
+               if ($user) {
+                       $user->isolate(1);
+                       $user->close();
+                       push @out, $self->msg($create ? 'isoc' : 'iso', $call);
+               } else {
+                       push @out, $self->msg('e3', "Set/Isolate", $call);
+               }
        }
-  }
 }
 return (1, @out);
index dd9e0a372d0bc54605631f6e955bec24d4e4a821..81627f337ec814b3e9dcf191942a3b6b0cf84140 100644 (file)
@@ -15,24 +15,24 @@ my @out;
 my $user;
 my $create;
 
-return (0) if $self->priv < 5;
+return (1, $self->msg('e5')) if $self->priv < 5;
 
 foreach $call (@args) {
-  $call = uc $call;
-  my $chan = DXChannel->get($call);
-  if ($chan) {
-       push @out, $self->msg('nodee1', $call);
-  } else {
-    $user = DXUser->get($call);
-       $create = !$user;
-       $user = DXUser->new($call) if $create;
-       if ($user) {
-         $user->sort('A');
-         $user->close();
-      push @out, $self->msg($create ? 'nodec' : 'node', $call);
+       $call = uc $call;
+       my $chan = DXChannel->get($call);
+       if ($chan) {
+               push @out, $self->msg('nodee1', $call);
        } else {
-      push @out, $self->msg('e3', "Set Node", $call);
+               $user = DXUser->get_exact($call);
+               $create = !$user;
+               $user = DXUser->new($call) if $create;
+               if ($user) {
+                       $user->sort('A');
+                       $user->close();
+                       push @out, $self->msg($create ? 'nodec' : 'node', $call);
+               } else {
+                       push @out, $self->msg('e3', "Set Node", $call);
+               }
        }
-  }
 }
 return (1, @out);
index 457903778f403a521d012b497776838198360915..8464cb26cce65beab24b3defaa97fecf9f36da99 100644 (file)
@@ -24,7 +24,7 @@ foreach $call (@args) {
        $call = uc $call;
        my $dxchan = DXChannel->get($call);
        $user = $dxchan->user if $dxchan;
-       $user = DXUser->get($call) unless $user;
+       $user = DXUser->get_exact($call) unless $user;
        if ($user) {
                unless ($user->sort eq 'A' || $user->sort eq 'S') {
                        push @out, $self->msg('e13', $call);
index 457903778f403a521d012b497776838198360915..8464cb26cce65beab24b3defaa97fecf9f36da99 100644 (file)
@@ -24,7 +24,7 @@ foreach $call (@args) {
        $call = uc $call;
        my $dxchan = DXChannel->get($call);
        $user = $dxchan->user if $dxchan;
-       $user = DXUser->get($call) unless $user;
+       $user = DXUser->get_exact($call) unless $user;
        if ($user) {
                unless ($user->sort eq 'A' || $user->sort eq 'S') {
                        push @out, $self->msg('e13', $call);
index 5a475e7fe70ec90c07b1a8280a77276912eb22bc..60804a779f3eba72bb1cef0e2912920baff86045 100644 (file)
@@ -32,7 +32,7 @@ foreach $call (@args) {
                        $ref->user->priv($priv);
                        $ref->user->put();
                }
-               if (!$ref && ($user = DXUser->get($call))) {
+               if (!$ref && ($user = DXUser->get_exact($call))) {
                        $user->priv($priv);
                        $user->put();
                }
diff --git a/cmd/set/spider.pl b/cmd/set/spider.pl
new file mode 100644 (file)
index 0000000..b4ee04e
--- /dev/null
@@ -0,0 +1,38 @@
+#
+# set user type to 'S' for Spider node
+#
+# Please note that this is only effective if the user is not on-line
+#
+# Copyright (c) 1998 - Dirk Koopman
+#
+# $Id$
+#
+
+my ($self, $line) = @_;
+my @args = split /\s+/, $line;
+my $call;
+my @out;
+my $user;
+my $create;
+
+return (1, $self->msg('e5')) if $self->priv < 5;
+
+foreach $call (@args) {
+       $call = uc $call;
+       my $chan = DXChannel->get($call);
+       if ($chan) {
+               push @out, $self->msg('nodee1', $call);
+       } else {
+               $user = DXUser->get_exact($call);
+               $create = !$user;
+               $user = DXUser->new($call) if $create;
+               if ($user) {
+                       $user->sort('S');
+                       $user->close();
+                       push @out, $self->msg($create ? 'nodesc' : 'nodes', $call);
+               } else {
+                       push @out, $self->msg('e3', "Set Spider", $call);
+               }
+       }
+}
+return (1, @out);
index 8c8fda85c6b516afc3d769eb6e4a4c38a085c5cc..9616f6579cfcf90f88cb7a483ee6dd75c3e9c3c5 100644 (file)
@@ -25,7 +25,7 @@ if ($self->priv < 9) {
 
 my @out;
 $call = uc $call;
-my $user = DXUser->get($call);
+my $user = DXUser->get_exact($call);
 unless ($user) {
        $user = DXUser->new($call);
        push @out, $self->msg('spf1', $call);
index ced47037b901b6951ec62f22fd323cb7a9254784..827ff672d3a26210af2e95aabe8ddabc0f53a6ff 100644 (file)
@@ -24,7 +24,9 @@ if ($argv[1] eq '>') {
 }
 
 my $call = $via ? $via : $to;
-my $ref = DXCluster->get($call);
+my $ref = DXCluster->get_exact($call);     # try an exact call
+$ref = DXCluster->get($call) unless $ref;  # try one ignoring SSID
+$ref = DXChannel->get($call) unless $ref;  # is it local?
 
 # if we haven't got an explicit via and we can't see them, try their node
 unless ($ref || $via) {
index 13fbf655cf04b851526beb71c61c6f010c153e41..143d5ebce70bbba49c1d12d2cf4d3b53cd3e11e3 100644 (file)
@@ -15,19 +15,19 @@ my @out;
 my $user;
 my $create;
 
-return (0) if $self->priv < 5;
+return (1, $self->msg('e5')) if $self->priv < 5;
 
 foreach $call (@args) {
-  $call = uc $call;
-  my $chan = DXChannel->get($call);
-  if ($chan) {
-       push @out, $self->msg('nodee1', $call);
-  } else {
-    $user = DXUser->get($call);
-       return (1, $self->msg('usernf', $call)) if !$user; 
-       $user->isolate(0);
-       $user->close();
-    push @out, $self->msg('isou', $call);
-  }
+       $call = uc $call;
+       my $chan = DXChannel->get($call);
+       if ($chan) {
+               push @out, $self->msg('nodee1', $call);
+       } else {
+               $user = DXUser->get_exact($call);
+               return (1, $self->msg('usernf', $call)) if !$user; 
+               $user->isolate(0);
+               $user->close();
+               push @out, $self->msg('isou', $call);
+       }
 }
 return (1, @out);
index bd0a29efa8c95d517377d4b783fb3b6a60bcb2ce..5fab45ebe178cbed5183a12af80da2dfb337512c 100644 (file)
@@ -15,19 +15,19 @@ my @out;
 my $user;
 my $create;
 
-return (0) if $self->priv < 5;
+return (1, $self->msg('e5')) if $self->priv < 5;
 
 foreach $call (@args) {
-  $call = uc $call;
-  my $chan = DXChannel->get($call);
-  if ($chan) {
-       push @out, $self->msg('nodee1', $call);
-  } else {
-    $user = DXUser->get($call);
-       return (1, $self->msg('usernf', $call)) if !$user; 
-       $user->sort('U');
-       $user->close();
-    push @out, $self->msg('nodeu', $call);
-  }
+       $call = uc $call;
+       my $chan = DXChannel->get($call);
+       if ($chan) {
+               push @out, $self->msg('nodee1', $call);
+       } else {
+               $user = DXUser->get_exact($call);
+               return (1, $self->msg('usernf', $call)) if !$user; 
+               $user->sort('U');
+               $user->close();
+               push @out, $self->msg('nodeu', $call);
+       }
 }
 return (1, @out);
index cc8697f90030a50c3e495f2989a26c9e7e97f02b..5cff108b8c69da91dcd8b881012d1a100406d35b 100644 (file)
@@ -34,7 +34,7 @@
 
 package DXMsg;
 
-@swap = (
+@swop = (
 
 ); 
 
index 99e2bfe5fe55692b5d70adc418f6e1b235ff7719..39153ea4b40ae8120c756d83bba9d762a7d8be6f 100644 (file)
@@ -84,7 +84,7 @@ sub start
        my $node = DXNode->get($main::mycall) or die "$main::mycall not allocated in DXNode database";
        my $cuser = DXNodeuser->new($self, $node, $call, 0, 1);
        $node->dxchan($self) if $call eq $main::myalias; # send all output for mycall to myalias
-       
+
        # issue a pc16 to everybody interested
        my $nchan = DXChannel->get($main::mycall);
        my @pc16 = DXProt::pc16($nchan, $cuser);
@@ -297,6 +297,9 @@ sub finish
        my $self = shift;
        my $call = $self->call;
 
+       # I was the last node visited
+    $self->user->node($main::mycall);
+               
        # log out text
        if (-e "$main::data/logout") {
                open(I, "$main::data/logout") or confess;
index 61e72661270c41c552c61ae54027accb7879b890..d99dd3df1540f8a0a819439c01d1a4a063ae9fa6 100644 (file)
@@ -844,6 +844,9 @@ sub finish
        # now broadcast to all other ak1a nodes that I have gone
        broadcast_ak1a(pc21($call, 'Gone.'), $self) unless $self->{isolate};
 
+       # I was the last node visited
+    $self->user->node($main::mycall);
+
        # send info to all logged in thingies
        $self->tell_login('logoutn');
 
index 6a33b1efde6c3fe0f9a68d0b1d3ce8f4248cbc1b..5f5e2ea83230c6a47b214a0a0ddfb83a56262aff 100644 (file)
@@ -114,8 +114,10 @@ package DXM;
                                namee2 => 'Can\'t find user $_[0]!',
                                name => 'Your name is now \"$_[0]\"',
                                node => '$_[0] set as AK1A style Node',
-                               nodeu => '$_[0] set back as a User',
                                nodec => '$_[0] created as AK1A style Node',
+                               nodes => '$_[0] set as DXSpider style Node',
+                               nodesc => '$_[0] created as DXSpider style Node',
+                               nodeu => '$_[0] set back as a User',
                                nodee1 => 'You cannot use this command whilst your target ($_[0]) is on-line',
                                ok => 'Operation successful',
                                outconn => 'Outstanding connect to $_[0]',
index 8fa8acc2734c6faa82f5d5ca4cffbf3bd801b5d0..a46e3b2d58f692e9905666b4618484a47c8be18a 100755 (executable)
@@ -113,21 +113,31 @@ sub rec
        # set up the basic channel info - this needs a bit more thought - there is duplication here
        if (!defined $dxchan) {
                my ($sort, $call, $line) = $msg =~ /^(\w)(\S+)\|(.*)$/;
-
-                # is there one already connected to me ? 
+               my ($scall, $ssid) = split /-/, $call;
+               
+               # adjust the callsign if it has an SSID, SSID <= 8 are legal > 8 are netrom connections
+        if ($ssid) {
+                       $ssid = 15 if $ssid > 15;
+                       if ($ssid > 8) {
+                               $ssid = 15 - $ssid;
+                               $call = "$scall-$ssid";
+                       }
+               }
+               # is there one already connected to me - locally? 
                my $user = DXUser->get($call);
                if (DXChannel->get($call)) {
-                       my $mess = DXM::msg($lang, $user->sort eq 'A' ? 'concluster' : 'conother', $call);
+                       my $mess = DXM::msg($lang, ($user && $user->sort eq 'A') ? 'concluster' : 'conother', $call);
                        already_conn($conn, $call, $mess);
                        return;
                }
                
-               # is there one already connected elsewhere in the cluster (and not a cluster)
+               # is there one already connected elsewhere in the cluster?
                if ($user) {
                        if (($user->sort eq 'A' || $call eq $myalias) && !DXCluster->get_exact($call)) {
                                ;
                        } else {
-                               if (DXCluster->get($call) || DXChannel->get($call)) {
+                               if (DXCluster->get_exact($call)) {
                                        my $mess = DXM::msg($lang, $user->sort eq 'A' ? 'concluster' : 'conother', $call);
                                        already_conn($conn, $call, $mess);
                                        return;
@@ -135,7 +145,7 @@ sub rec
                        }
                        $user->{lang} = $main::lang if !$user->{lang}; # to autoupdate old systems
                } else {
-                       if (DXCluster->get($call)) {
+                       if (DXCluster->get_exact($call)) {
                                my $mess = DXM::msg($lang, 'conother', $call);
                                already_conn($conn, $call, $mess);
                                return;