use Geomag;
use CmdAlias;
use Filter;
-use Local;
use DXDb;
-use Data::Dumper;
+use AnnTalk;
+use WCY;
+use Data::Dumper;
use Fcntl ':flock';
+use Local;
+
package main;
@inqueue = (); # the main input queue, an array of hashes
$systime = 0; # the time now (in seconds)
-$version = "1.40"; # the version no of the software
+$version = "1.42"; # the version no of the software
$starttime = 0; # the starting time of the cluster
$lockfn = "cluster.lock"; # lock file name
@outstanding_connects = (); # list of outstanding connects
if (!defined $msg || (defined $err && $err)) {
if ($dxchan) {
+ if (defined $err) {
+ $conn->disconnect;
+ undef $conn;
+ $dxchan->conn(undef);
+ }
$dxchan->disconnect;
} elsif ($conn) {
$conn->disconnect;
# is there one already connected to me - locally?
my $user = DXUser->get($call);
if (DXChannel->get($call)) {
- my $mess = DXM::msg($lang, ($user && $user->sort eq 'A') ? 'concluster' : 'conother', $call);
+ my $mess = DXM::msg($lang, ($user && $user->is_node) ? 'concluster' : 'conother', $call);
already_conn($conn, $call, $mess);
return;
}
# is there one already connected elsewhere in the cluster?
if ($user) {
- if (($user->sort eq 'A' || $call eq $myalias) && !DXCluster->get_exact($call)) {
+ if (($user->is_node || $call eq $myalias) && !DXCluster->get_exact($call)) {
;
} else {
if (DXCluster->get_exact($call)) {
- my $mess = DXM::msg($lang, $user->sort eq 'A' ? 'concluster' : 'conother', $call);
+ my $mess = DXM::msg($lang, $user->is_node ? 'concluster' : 'conother', $call);
already_conn($conn, $call, $mess);
return;
}
}
# create the channel
- $dxchan = DXCommandmode->new($call, $conn, $user) if ($user->sort eq 'U');
- $dxchan = DXProt->new($call, $conn, $user) if ($user->sort eq 'A');
- $dxchan = BBS->new($call, $conn, $user) if ($user->sort eq 'B');
+ $dxchan = DXCommandmode->new($call, $conn, $user) if $user->is_user;
+ $dxchan = DXProt->new($call, $conn, $user) if $user->is_node;
+ $dxchan = BBS->new($call, $conn, $user) if $user->is_bbs;
die "Invalid sort of user on $call = $sort" if !$dxchan;
}
# disconnect nodes
foreach $dxchan (DXChannel->get_all()) {
- next unless $dxchan->is_ak1a;
+ next unless $dxchan->is_node;
disconnect($dxchan) unless $dxchan == $DXProt::me;
}
Msg->event_loop(1, 0.05);
# disconnect users
foreach $dxchan (DXChannel->get_all()) {
- next if $dxchan->is_ak1a;
+ next if $dxchan->is_node;
disconnect($dxchan) unless $dxchan == $DXProt::me;
}
Msg->event_loop(1, 0.05);
my $data = $self->{data};
my $dxchan = $self->{dxchan};
- my ($sort, $call, $line) = $data =~ /^(\w)([A-Z0-9\-]+)\|(.*)$/;
+ my ($sort, $call, $line) = $data =~ /^(\w)([^\|]+)\|(.*)$/;
my $error;
# the above regexp must work
Log('cluster', "DXSpider V$version started");
# banner
-dbg('err', "DXSpider DX Cluster Version $version\nCopyright (c) 1998-1999 Dirk Koopman G1TLH");
+dbg('err', "DXSpider DX Cluster Version $version", "Copyright (c) 1998-2000 Dirk Koopman G1TLH");
# load Prefixes
dbg('err', "loading prefixes ...");
# initialise the Geomagnetic data engine
Geomag->init();
+WCY->init();
# initial the Spot stuff
Spot->init();
# this, such as it is, is the main loop!
dbg('err', "orft we jolly well go ...");
-Log('err', "DXSpider version $version started...");
#open(DB::OUT, "|tee /tmp/aa");
+$SIG{PIPE} = sub {
+ #$DB::single = 1;
+ dbg('err', "Broken PIPE signal received");
+};
+
for (;;) {
my $timenow;
# $DB::trace = 1;