shift @list;
}
-push @out, $main::routeroot->config($nodes_only, 0, [], @list);
+# root node
+push @out, $main::mycall;
+
+# now show the config in terms of each of the root nodes view
+foreach my $n ($main::routeroot->links) {
+ my $r = Route::Node::get($n);
+ push @out, $r->config($nodes_only, 1, [], @list) if $r;
+}
return (1, @out);
if ($self->{prompt}) {
$self->send($self->{prompt});
} else {
- $self->send($self->msg($self->here ? 'pr' : 'pr2', $self->call, cldate($main::systime), ztime($main::systime)));
+ my $prkey = $self->here ? 'pr' : 'pr2';
+ my $mail = DXMsg::for_me($self->call) ? $self->msg('newmail') : "";
+
+ $self->send($self->msg($prkey, $self->call, cldate($main::systime), ztime($main::systime), $mail));
}
}
while (@_) {
my $line = shift;
if ($self->user->wantpc90) {
- $line = mungepc90($line);
+ my ($pcno) = $line =~ /^PC(\d\d)/;
+ if ($pcno < 90) {
+ if ($pcno == 16 || $pcno == 17 || $pcno == 19 || $pcno == 21) {
+ $line = mungepc91($main::mycall, $line);
+ } else {
+ $line = mungepc90($line);
+ }
+ }
} else {
removepc91($line);
removepc90($line);
return;
}
}
- } else {
- if ($pcno == 16 || $pcno == 17 || $pcno == 19 || $pcno == 21) {
- $line = mungepc91($origin, $line);
- } else {
- $line = mungepc90($line);
- }
}
no strict 'subs';
# if the origin isn't the same as the INTERFACE, then reparent, creating nodes as necessary
if ($origin ne $self->call) {
my $op = Route::Node::get($origin);
- unless ($op) {
+ if ($op) {
+ $parent->add($op) unless $parent->haslink($op);
+ } else {
$op = $parent->add($origin, 5000, Route::here(1));
my $user = DXUser->get_current($origin);
if (!$user) {
my $parent = Route::Node::get($self->{call});
unless ($parent) {
- dbg("DXPROT: my parent $self->{call} has disappeared");
+ dbg("DXPROT: my parent $origin has disappeared");
$self->disconnect;
return;
}
+ my $or = Route::Node::get($origin) if $origin ne $self->{call};
+ $parent = $or if $or;
+
if ($call ne $main::mycall) { # don't allow malicious buggers to disconnect me!
my $node = Route::Node::get($call);
if ($node) {
namee1 => 'Please enter your name, set/name <your name>',
namee2 => 'Can\'t find user $_[0]!',
name => 'Your name is now \"$_[0]\"',
+ newmail => ' (New Mail)',
nodea => '$_[0] set as AK1A style Node',
nodeac => '$_[0] created as AK1A style Node',
nodeb => '$_[0] set as BBS',
pinge1 => 'Cannot ping yourself!',
pingint => 'Ping interval on $_[0] set to $_[1] secs',
'pos' => 'From Callsign: $_[0] Lat: $_[1] Long: $_[2]',
- pr => '$_[0] de $main::mycall $_[1] $_[2] >',
- pr2 => '($_[0]) de $main::mycall $_[1] $_[2] >',
+ pr => '$_[0] de $main::mycall $_[1] $_[2]$_[3] >',
+ pr2 => '($_[0]) de $main::mycall $_[1] $_[2]$_[3] >',
prs => 'Prompt now set to \"$_[0]\"',
pru => 'Prompt now set back to default',
priv => 'Privilege level changed on $_[0]',
{
my $self = shift;
my $nodes_only = shift;
- my $level = shift;
+ my $level = shift || 0;
my $seen = shift;
my @out;
my $line;
- my $call = $self->user_call;
+ my $ucall = $self->user_call;
+ my $call = $self->{call};
my $printit = 1;
+
+ return if $level > 1 && DXChannel->get($call);
+
+# my @seen = @$seen || ();
+# return if $level > 1 && grep $call eq $_, @seen;
+# push @seen, @{$self->{links}};
+
# allow ranges
if (@_) {
}
if ($printit) {
- $line = ' ' x ($level*2) . "$call";
- $call = ' ' x length $call;
+ $line = ' ' x ($level*3) . "$ucall";
+ push @out, $line;
+# push @$seen, $call;
- # recursion detector
- if ((DXChannel->get($self->{call}) && $level > 1) || grep $self->{call} eq $_, @$seen) {
- $line .= ' ...';
- push @out, $line;
- return @out;
- }
- push @$seen, $self->{call};
-
- # print users
- unless ($nodes_only) {
- if (@{$self->{users}}) {
- $line .= '->';
- foreach my $ucall (sort @{$self->{users}}) {
- my $uref = Route::User::get($ucall);
- my $c;
- if ($uref) {
- $c = $uref->user_call;
- } else {
- $c = "$ucall?";
- }
- if ((length $line) + (length $c) + 1 < 79) {
- $line .= $c . ' ';
- } else {
- $line =~ s/\s+$//;
- push @out, $line;
- $line = ' ' x ($level*2) . "$call->$c ";
- }
+ foreach my $ncall (sort @{$self->{links}}) {
+ my $nref = Route::Node::get($ncall);
+
+ if ($nref) {
+ my $c = $nref->user_call;
+ dbg("recursing from $call -> $c (" . (join ',', @$seen) . ")") if isdbg('routec');
+
+ unless (grep $ncall eq $_, @$seen) {
+# push @seen, $call;
+ push @$seen, $ncall;
+ push @out, $nref->config($nodes_only, $level+1, $seen, @_);
+# pop @$seen;
+# pop @seen;
+ } else {
+# $line .= "->$ncall" if $line !~ $ncall;
+# push @out, $line;
}
+ } else {
+ push @out, ' ' x (($level+1)*2) . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_);
}
}
- $line =~ s/->$//g;
- $line =~ s/\s+$//;
- push @out, $line if length $line;
- }
-
- # deal with more nodes
- foreach my $ncall (sort @{$self->{links}}) {
- my $nref = Route::Node::get($ncall);
-
- if ($nref) {
- my $c = $nref->user_call;
-# dbg("recursing from $call -> $c") if isdbg('routec');
- push @out, $nref->config($nodes_only, $level+1, $seen, @_);
- } else {
- push @out, ' ' x (($level+1)*2) . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_);
- }
+# pop @$seen;
}
return @out;
return $self->_dellist('links', @_);
}
+sub haslink
+{
+ my $self = shift;
+ my $other = shift->{call};
+ return grep $other eq $_, @{$self->{links}};
+}
+
#
# track destruction
#