error messages).
7. Improve stat/route_node and stat/route_user for diagnostics.
4. Make PC50s come out in one heap on all channels every 14 mins, instead of
on the 14th minute in the connection time for each channel. This should
reduce (slightly) the dups that are dumped.
+5. Speed up input queue processing (a lot).
+6. make set/isolate and acc/route mutually exclusive (and issue appropriate
+error messages).
+7. Improve stat/route_node and stat/route_user for diagnostics.
01Sep01=======================================================================
1. Change build number calc (hopefully for the last time)
27Aug01=======================================================================
my $sort = 'route';
my ($r, $filter, $fno) = $Route::filterdef->cmd($self, $sort, $type, $line);
-return (0, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
+return (1, $r ? $filter : $self->msg('filter1', $fno, $filter->{name}));
$user = DXUser->get($call);
$create = !$user;
$user = DXUser->new($call) if $create;
+ my $f;
+ push(@out, $self->msg('isoari', $call)), $f++ if Filter::getfn('route', $call, 1);
+ push(@out, $self->msg('isoaro', $call)), $f++ if Filter::getfn('route', $call, 0);
if ($user) {
- $user->isolate(1);
- $user->close();
- push @out, $self->msg($create ? 'isoc' : 'iso', $call);
- Log('DXCommand', $self->msg($create ? 'isoc' : 'iso', $call));
+ unless ($f) {
+ $user->isolate(1);
+ $user->close();
+ push @out, $self->msg($create ? 'isoc' : 'iso', $call);
+ Log('DXCommand', $self->msg($create ? 'isoc' : 'iso', $call));
+ }
} else {
push @out, $self->msg('e3', "Set/Isolate", $call);
}
#
my ($self, $line) = @_;
+my @out;
my @list = split /\s+/, $line; # generate a list of callsigns
@list = ($self->call) if !@list; # my channel if no callsigns
+if ($self->priv > 5 && @list && uc $list[0] eq 'ALL') {
+ push @out, "Node Callsigns in Routing Table";
+ @list = sort map {$_->call} Route::Node::get_all();
+ my $count = @list;
+ my $n = int $self->width / 10;
+ $n ||= 8;
+ while (@list > $n) {
+ push @out, join(' ', map {sprintf "%9s",$_ } splice(@list, 0, $n));
+ }
+ push @out, join(' ', map {sprintf "%9s",$_ } @list) if @list;
+ push @out, "$count Nodes";
+ return (1, @out);
+}
my $call;
-my @out;
foreach $call (@list) {
$call = uc $call;
my $ref = Route::Node::get($call);
if ($ref) {
@out = print_all_fields($self, $ref, "Route::Node Information $call");
} else {
- push @out, "Route::User: $call not found";
+ push @out, "Route::Node: $call not found";
}
push @out, "" if @list > 1;
}
#
my ($self, $line) = @_;
+my @out;
my @list = split /\s+/, $line; # generate a list of callsigns
@list = ($self->call) if !@list; # my channel if no callsigns
+if ($self->priv > 5 && @list && uc $list[0] eq 'ALL') {
+ push @out, "User Callsigns in Routing Table";
+ @list = sort map {$_->call} Route::User::get_all();
+ my $count = @list;
+ my $n = int $self->width / 10;
+ $n ||= 8;
+ while (@list > $n) {
+ push @out, join(' ', map {sprintf "%9s",$_ } splice(@list, 0, $n));
+ }
+ push @out, join(' ', map {sprintf "%9s",$_ } @list) if @list;
+ push @out, "$count Users";
+ return (1, @out);
+}
my $call;
-my @out;
foreach $call (@list) {
$call = uc $call;
my $ref = Route::User::get($call);
if ($ref) {
- @out = print_all_fields($self, $ref, "Route::User Information $call");
+ push @out, print_all_fields($self, $ref, "Route::User Information $call");
} else {
push @out, "Route::User: $call not found";
}
cq => '0,CQ Zone',
enhanced => '5,Enhanced Client,yesno',
senddbg => '8,Sending Debug,yesno',
+ width => '0,Column Width',
);
use vars qw($VERSION $BRANCH);
$self->{lang} = $user->lang || $main::lang || 'en';
$self->{pagelth} = $user->pagelth || 20;
$self->{priv} = 0 if $line =~ /^(ax|te)/; # set the connection priv to 0 - can be upgraded later
+ ($self->{width}) = $line =~ /width=(\d+)/;
+ $self->{width} = 80 unless $self->{width} && $self->{width} > 80;
$self->{consort} = $line; # save the connection type
# set some necessary flags on the user if they are connecting
$self->{isolate} = $user->{isolate};
$self->{consort} = $line; # save the connection type
$self->{here} = 1;
+ $self->{width} = 80;
# get the output filters
$self->{spotsfilter} = Filter::read_in('spots', $call, 0) || Filter::read_in('spots', 'node_default', 0);
$self->{wwvfilter} = Filter::read_in('wwv', $call, 0) || Filter::read_in('wwv', 'node_default', 0);
$self->{wcyfilter} = Filter::read_in('wcy', $call, 0) || Filter::read_in('wcy', 'node_default', 0);
$self->{annfilter} = Filter::read_in('ann', $call, 0) || Filter::read_in('ann', 'node_default', 0) ;
- $self->{routefilter} = Filter::read_in('route', $call, 0) || Filter::read_in('route', 'node_default', 0) ;
+ $self->{routefilter} = Filter::read_in('route', $call, 0) || Filter::read_in('route', 'node_default', 0) unless $self->{isolate} ;
# get the INPUT filters (these only pertain to Clusters)
$self->{inwwvfilter} = Filter::read_in('wwv', $call, 1) || Filter::read_in('wwv', 'node_default', 1);
$self->{inwcyfilter} = Filter::read_in('wcy', $call, 1) || Filter::read_in('wcy', 'node_default', 1);
$self->{inannfilter} = Filter::read_in('ann', $call, 1) || Filter::read_in('ann', 'node_default', 1);
- $self->{inroutefilter} = Filter::read_in('route', $call, 1) || Filter::read_in('route', 'node_default', 1);
+ $self->{inroutefilter} = Filter::read_in('route', $call, 1) || Filter::read_in('route', 'node_default', 1) unless $self->{isolate};
# set unbuffered and no echo
$self->send_now('B',"0");
my @out;
my @fields = $ref->fields;
my $field;
+ my $width = $self->width - 1;
+ $width ||= 80;
foreach $field (sort {$ref->field_prompt($a) cmp $ref->field_prompt($b)} @fields) {
if (defined $ref->{$field}) {
my ($priv, $ans) = promptf($ref->field_prompt($field), $ref->{$field});
my @tmp;
- if (length $ans > 79) {
+ if (length $ans > $width) {
my ($p, $a) = split /: /, $ans, 2;
my $l = (length $p) + 2;
- my $al = 79 - $l;
+ my $al = ($width - 1) - $l;
my $bit;
while (length $a > $al ) {
($bit, $a) = unpack "A$al A*", $a;
return $dxchan->msg('filter5') unless $line;
my ($r, $filter, $fno, $user, $s) = $self->parse($dxchan, $sort, $line);
- return (1,$filter) if $r;
+ my $u = DXUser->get_current($user);
+ return (1, $dxchan->msg('isow', $user)) if $u && $u->isolate;
+ return (1, $filter) if $r;
my $fn = "filter$fno";
iso => '$_[0] Isolated',
isou => '$_[0] UnIsolated',
isoc => '$_[0] created and Isolated',
+ isoari => 'there is an input route filter for $_[0]; clear/route input $_[0] first',
+ isoaro => 'there is an output route filter for $_[0]; clear/route $_[0] first',
+ isow => '$_[0] is isolated; unset/isolate $_[0] first',
l1 => 'Sorry $_[0], you are already logged on on another channel',
l2 => 'Hello $_[0], this is $main::mycall in $main::myqth\nrunning DXSpider V$main::version build $main::build',
lang => 'Language is now $_[0]',
# delete parent from this call's parent list
$pref->_delnode($self);
- my @ref = $self->_delparent($pref);
+ $self->_delparent($pref);
my @nodes;
my $ncall = $self->{call};
# is this the last connection, I have no parents anymore?
- unless (@ref) {
+ unless (@{$self->{parent}}) {
foreach my $rcall (@{$self->{nodes}}) {
next if grep $rcall eq $_, @_;
my $r = Route::Node::get($rcall);
return $self;
}
+sub get_all
+{
+ return values %list;
+}
+
sub del
{
my $self = shift;
my $pref = shift;
- my @out = $self->delparent($pref);
- return @out;
+ $self->delparent($pref);
+ unless (@{$self->{parent}}) {
+ delete $list{$self->{call}};
+ return $self;
+ }
+ return undef;
}
sub get
$SIG{__DIE__} = \&sig_term;
-$conn->send_later("A$call|$connsort");
+$conn->send_later("A$call|$connsort width=$COLS");
$conn->send_later("I$call|set/page $maxshist");
$conn->send_later("I$call|set/nobeep");