From 7de34899527cbc4dfacdcc6452926b3d2d73792c Mon Sep 17 00:00:00 2001 From: djk Date: Wed, 24 Nov 1999 18:37:27 +0000 Subject: [PATCH] made ssids unique everywhere --- Changes | 11 +++++++++++ cmd/set/isolate.pl | 30 +++++++++++++++--------------- cmd/set/node.pl | 30 +++++++++++++++--------------- cmd/set/obscount.pl | 2 +- cmd/set/pinginterval.pl | 2 +- cmd/set/privilege.pl | 2 +- cmd/set/spider.pl | 38 ++++++++++++++++++++++++++++++++++++++ cmd/spoof.pl | 2 +- cmd/talk.pl | 4 +++- cmd/unset/isolate.pl | 24 ++++++++++++------------ cmd/unset/node.pl | 24 ++++++++++++------------ msg/swop.pl.issue | 2 +- perl/DXCommandmode.pm | 5 ++++- perl/DXProt.pm | 3 +++ perl/Messages | 4 +++- perl/cluster.pl | 22 ++++++++++++++++------ 16 files changed, 137 insertions(+), 68 deletions(-) create mode 100644 cmd/set/spider.pl diff --git a/Changes b/Changes index 37ea213d..acbf476b 100644 --- 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. diff --git a/cmd/set/isolate.pl b/cmd/set/isolate.pl index b008a9b0..34fe22a3 100644 --- a/cmd/set/isolate.pl +++ b/cmd/set/isolate.pl @@ -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); diff --git a/cmd/set/node.pl b/cmd/set/node.pl index dd9e0a37..81627f33 100644 --- a/cmd/set/node.pl +++ b/cmd/set/node.pl @@ -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); diff --git a/cmd/set/obscount.pl b/cmd/set/obscount.pl index 45790377..8464cb26 100644 --- a/cmd/set/obscount.pl +++ b/cmd/set/obscount.pl @@ -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); diff --git a/cmd/set/pinginterval.pl b/cmd/set/pinginterval.pl index 45790377..8464cb26 100644 --- a/cmd/set/pinginterval.pl +++ b/cmd/set/pinginterval.pl @@ -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); diff --git a/cmd/set/privilege.pl b/cmd/set/privilege.pl index 5a475e7f..60804a77 100644 --- a/cmd/set/privilege.pl +++ b/cmd/set/privilege.pl @@ -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 index 00000000..b4ee04e1 --- /dev/null +++ b/cmd/set/spider.pl @@ -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); diff --git a/cmd/spoof.pl b/cmd/spoof.pl index 8c8fda85..9616f657 100644 --- a/cmd/spoof.pl +++ b/cmd/spoof.pl @@ -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); diff --git a/cmd/talk.pl b/cmd/talk.pl index ced47037..827ff672 100644 --- a/cmd/talk.pl +++ b/cmd/talk.pl @@ -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) { diff --git a/cmd/unset/isolate.pl b/cmd/unset/isolate.pl index 13fbf655..143d5ebc 100644 --- a/cmd/unset/isolate.pl +++ b/cmd/unset/isolate.pl @@ -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); diff --git a/cmd/unset/node.pl b/cmd/unset/node.pl index bd0a29ef..5fab45eb 100644 --- a/cmd/unset/node.pl +++ b/cmd/unset/node.pl @@ -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); diff --git a/msg/swop.pl.issue b/msg/swop.pl.issue index cc8697f9..5cff108b 100644 --- a/msg/swop.pl.issue +++ b/msg/swop.pl.issue @@ -34,7 +34,7 @@ package DXMsg; -@swap = ( +@swop = ( ); diff --git a/perl/DXCommandmode.pm b/perl/DXCommandmode.pm index 99e2bfe5..39153ea4 100644 --- a/perl/DXCommandmode.pm +++ b/perl/DXCommandmode.pm @@ -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; diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 61e72661..d99dd3df 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -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'); diff --git a/perl/Messages b/perl/Messages index 6a33b1ef..5f5e2ea8 100644 --- a/perl/Messages +++ b/perl/Messages @@ -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]', diff --git a/perl/cluster.pl b/perl/cluster.pl index 8fa8acc2..a46e3b2d 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -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; -- 2.34.1