+28Jan22=======================================================================
+1. Fixed duplicate spot display.
25Jan22=======================================================================
1. Fixed grepdbg so that it does what -help says it does.
2. Replaced all " characters with ' in Messages. For some reason things in "
$maxerrors = 20; # the maximum number of concurrent errors allowed before disconnection
# object destruction
-sub DESTROY
-{
- my $self = shift;
- for (keys %$self) {
- if (ref($self->{$_})) {
- delete $self->{$_};
- }
- }
- dbg("DXChannel $self->{call} destroyed ($count)") if isdbg('chan');
- $count--;
-}
+# sub DESTROY
+# {
+# my $self = shift;
+# for (keys %$self) {
+# if (ref($self->{$_})) {
+# delete $self->{$_};
+# }
+# }
+# dbg("DXChannel $self->{call} destroyed ($count)") if isdbg('chan');
+# $count--;
+# }
# create a new channel object [$obj = DXChannel->new($call, $msg_conn_obj, $user_obj)]
sub alloc
my $ref;
my @out;
foreach $ref (values %channels) {
- push @out, $ref->{call} if $ref->is_node;
+ push @out, $ref->{call} if $ref && $ref->is_node;
}
return @out;
}
my $ref;
my @out;
foreach $ref (values %channels) {
- push @out, $ref if $ref->is_user;
+ push @out, $ref if $ref && $ref->is_user;
}
return @out;
}
$self->{name} = $name ? $name : $call;
$self->send($self->msg('l2',$self->{name}));
+ $self->send("Capabilities: ve7cc");
$self->state('prompt'); # a bit of room for further expansion, passwords etc
$self->{priv} = $user->priv || 0;
$self->{lang} = $user->lang || $main::lang || 'en';
unlink $fn;
}
+sub active
+{
+ return $dbm;
+}
+
sub check
{
my $s = shift;
use DXUtil;
use Julian;
-use Carp;
+use Carp qw(confess cluck);
use strict;
# make sure the directory exists
mkdir($ref->{prefix}, 0777) unless -e $ref->{prefix};
$logs{$ref} = $ref;
-
+ $ref->{jdate} = $ref->unixtoj($main::systime);
+
return $ref;
}
sub write($$$)
{
my ($self, $jdate, $line) = @_;
+ cluck("Log::write \$jdate undefined") unless $jdate;
+# cluck("Log::write \$self->jdate undefined") unless $self->{jdate};
if (!$self->{fh} ||
- $self->{mode} ne ">>" ||
- $jdate->year != $self->{jdate}->year ||
- $jdate->thing != $self->{jdate}->thing) {
+ $self->{mode} ne ">>" ||
+ $jdate->year !=
+ $self->{jdate}->year ||
+ $jdate->thing
+ != $self->{jdate}->thing) {
$self->open($jdate, ">>") or confess "can't open $self->{fn} $!";
}
delete $self->{fh};
}
-sub DESTROY
-{
- my $self = shift;
- delete $logs{$self};
- undef $self->{fh}; # close the filehandle
- delete $self->{fh} if $self->{fh};
-}
-
sub flushall
{
foreach my $l (values %logs) {
# The user is responsible for making sense of this!
sub Log
{
- my $t = time;
+ my $t = $main::systime;
$log->writeunix($t, join('^', $t, @_) );
}
foreach $dxchan (@dxchan) {
next if $dxchan == $main::me;
next if $dxchan == $self && $self->is_node;
+ next if $dxchan == $self;
+
if ($line =~ /PC61/ && !($dxchan->is_spider || $dxchan->is_user)) {
unless ($pc11) {
my @f = split /\^/, $line;
$filename = $ufn;
}
+sub active
+{
+ return $dbm;
+}
+
sub del_file
{
my ($pkg, $fn) = @_;
sub finish
{
+ print "DXUser Finishing\n";
undef $dbm;
untie %u;
}
}
-
+sub END
+{
+ finish() if $dbm;
+}
1;
__END__
$dbm->put($key, $value);
}
+sub active
+{
+ return $dbm;
+}
+
1;
}
# cease running this program, close down all the connections nicely
+our $is_ceasing;
+
sub cease
{
my $dxchan;
+ cluck("ceasing") if $is_ceasing;
+
+ return if $is_ceasing++;
+
unless ($is_win) {
$SIG{'TERM'} = 'IGNORE';
$SIG{'INT'} = 'IGNORE';
foreach $dxchan (DXChannel::get_all_nodes) {
$dxchan->disconnect(2) unless $dxchan == $main::me;
}
- Msg->event_loop(100, 0.01);
# disconnect users
foreach $dxchan (DXChannel::get_all_users) {
$dxchan->disconnect;
}
+ Msg->event_loop(100, 0.01);
+
# disconnect AGW
AGWMsg::finish();
BPQMsg::finish();
# end everything else
Msg->event_loop(100, 0.01);
- DXUser::finish();
DXDupe::finish();
+ QSL::finish();
+ DXUser::finish();
# close all databases
DXDb::closeall;
$l->close_server;
}
- LogDbg('cluster', "DXSpider v$version build $build (git: $gitbranch/$gitversion) using perl $^V on $^O ended");
+ $dbh->finish if $dbh;
+
+ LogDbg("DXSpider v$version build $build (git: $gitbranch/$gitversion) using perl $^V on $^O ended");
dbgclose();
Logclose();
- $dbh->finish if $dbh;
-
unlink $lockfn;
# $SIG{__WARN__} = $SIG{__DIE__} = sub {my $a = shift; cluck($a); };
exit(0);
my ($year) = (gmtime)[5];
$year += 1900;
LogDbg('cluster', "DXSpider v$version build $build (git: $gitbranch/$gitversion) using perl $^V on $^O started");
-dbg("Copyright (c) 1998-$year Dirk Koopman G1TLH");
+LogDbg('cluster', "Copyright (c) 1998-$year Dirk Koopman G1TLH");
+LogDbg('cluster', "Capabilities: ve7cc rbn");
# load Prefixes
dbg("loading prefixes ...");
last if --$decease <= 0;
}
}
-cease(0);
+cease(0) unless $is_ceasing;
exit(0);
+#
+sub END
+{
+ cease(0) unless $is_ceasing;
+}