X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fcluster.pl;h=8f5070ce52b17705e3ddf63d207f4108ed74e8b8;hb=870623b38dea43fbd5acf992d1e533cf3c6597cc;hp=655a986b1af35dfd881795a3a3ffb320a867dc82;hpb=70dbd742db4241e97496db69e89160ec573a5949;p=spider.git diff --git a/perl/cluster.pl b/perl/cluster.pl index 655a986b..8f5070ce 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -33,7 +33,7 @@ BEGIN { # try to create and lock a lockfile (this isn't atomic but # should do for now - $lockfn = "$root/perl/cluster.lck"; # lock file name + $lockfn = "$root/local/cluster.lck"; # lock file name if (-e $lockfn) { open(CLLOCK, "$lockfn") or die "Can't open Lockfile ($lockfn) $!"; my $pid = ; @@ -68,7 +68,6 @@ use DXCommandmode; use DXProtVars; use DXProtout; use DXProt; -use QXProt; use DXMsg; use DXCron; use DXConnect; @@ -98,6 +97,8 @@ use Editable; use Mrtg; use USDB; use UDPMsg; +use QSL; +use Thingy; use Data::Dumper; use IO::File; @@ -125,7 +126,7 @@ $reqreg = 0; # 1 = registration required, 2 = deregister people use vars qw($VERSION $BRANCH $build $branch); $VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); $BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); -$main::build += 6; # add an offset to make it bigger than last system +$main::build += 4; # add an offset to make it bigger than last system $main::build += $VERSION; $main::branch += $BRANCH; @@ -193,22 +194,7 @@ sub new_channel # create the channel - if ($user->wantnp) { - if ($user->passphrase && $main::me->user->passphrase) { - $dxchan = QXProt->new($call, $conn, $user); - } else { - unless ($user->passphrase) { - Log('DXCommand', "$call using NP but has no passphrase"); - dbg("$call using NP but has no passphrase"); - } - unless ($main::me->user->passphrase) { - Log('DXCommand', "$main::mycall using NP but has no passphrase"); - dbg("$main::mycall using NP but has no passphrase"); - } - already_conn($conn, $call, "Need to exchange passphrases"); - return; - } - } elsif ($user->is_node) { + if ($user->is_node) { $dxchan = DXProt->new($call, $conn, $user); } elsif ($user->is_user) { $dxchan = DXCommandmode->new($call, $conn, $user); @@ -240,6 +226,13 @@ sub rec } } +# remove any outstanding entries on the inqueue after a disconnection (usually) +sub clean_inqueue +{ + my $dxchan = shift; + @inqueue = grep {$_->{dxchan} != $dxchan} @inqueue; +} + sub login { return \&new_channel; @@ -328,7 +321,7 @@ sub process_inqueue return unless defined $sort; # do the really sexy console interface bit! (Who is going to do the TK interface then?) - dbg("<- $sort $call $line\n") if $sort ne 'D' && isdbg('chan'); + dbg("<- $sort $call $line") if $sort ne 'D' && isdbg('chan'); if ($self->{disconnecting}) { dbg('In disconnection, ignored'); next; @@ -399,9 +392,9 @@ dbg("DXSpider Version $version, build $build started"); # load Prefixes dbg("loading prefixes ..."); -my $r = Prefix::load(); -confess $r if $r; dbg(USDB::init()); +my $r = Prefix::init(); +confess $r if $r; # load band data dbg("loading band data ..."); @@ -489,10 +482,14 @@ Spot->init(); # initialise the protocol engine dbg("Start Protocol Engines ..."); DXProt->init(); -QXProt->init(); # put in a DXCluster node for us here so we can add users and take them away -$routeroot = Route::Node->new($mycall, $version*100+5300, Route::here($main::me->here)|Route::conf($main::me->conf)); +$routeroot = Route::Node->new($mycall); +$routeroot->version($version*100+5300); +$routeroot->here($main::me->here || 1); +$routeroot->conf($main::me->conf || 0); +$routeroot->add_dxchan($me); +$routeroot->lastseen(time); # make sure that there is a routing OUTPUT node default file #unless (Filter::read_in('route', 'node_default', 0)) { @@ -515,6 +512,7 @@ DXDb::load(); # starting local stuff dbg("doing local initialisation ..."); +QSL::init(1); eval { Local::init(); }; @@ -542,14 +540,16 @@ for (;;) { DXCron::process(); # do cron jobs DXCommandmode::process(); # process ongoing command mode stuff DXProt::process(); # process ongoing ak1a pcxx stuff - QXProt::process(); DXConnect::process(); DXMsg::process(); DXDb::process(); DXUser::process(); DXDupe::process(); AGWMsg::process(); - + + # this where things really start to happen (in DXSpider 2) + Thingy::process(); + eval { Local::process(); # do any localised processing };