made ssids unique everywhere

This commit is contained in:
djk 1999-11-24 18:37:27 +00:00
parent 09c40605dd
commit 7de3489952
16 changed files with 137 additions and 68 deletions

11
Changes
View File

@ -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.

View 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);

View 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);

View 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);

View 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);

View 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();
}

38
cmd/set/spider.pl Normal file
View File

@ -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);

View 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);

View 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) {

View 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);

View 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);

View File

@ -34,7 +34,7 @@
package DXMsg;
@swap = (
@swop = (
);

View 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;

View 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');

View 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]',

View File

@ -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;