fix 1.53 to work with old version method
[spider.git] / perl / cluster.pl
index 003ae845becc11c9f73a8292333bfb91e17748c0..e8e7cb0568b0f51fef1d93ff7a2aa50b55278452 100755 (executable)
@@ -68,7 +68,6 @@ use DXCommandmode;
 use DXProtVars;
 use DXProtout;
 use DXProt;
-use Aranea;
 use DXMsg;
 use DXCron;
 use DXConnect;
@@ -99,10 +98,10 @@ use Mrtg;
 use USDB;
 use UDPMsg;
 use QSL;
-use Thingy;
 use RouteDB;
-use AMsg;
 use DXXml;
+use DXSql;
+use IsoTime;
 
 use Data::Dumper;
 use IO::File;
@@ -117,7 +116,7 @@ use strict;
 use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects 
                        $zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr 
                        $clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting
-                       $allowdxby $dbh $dsn $dbuser $dbpass
+                       $allowdxby $dbh $dsn $dbuser $dbpass $do_xml
                   );
 
 @inqueue = ();                                 # the main input queue, an array of hashes
@@ -131,15 +130,6 @@ $bumpexisting = 1;                         # 1 = allow new connection to disconnect old, 0 - don't al
 $allowdxby = 0;                                        # 1 = allow "dx by <othercall>", 0 - don't allow it
 
 
-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 += $VERSION;
-$main::branch += $BRANCH;
-$main::build += 1;                             # fudge (put back for now)
-
-
-      
 # send a message to call on conn and disconnect
 sub already_conn
 {
@@ -351,14 +341,9 @@ $build += $main::version;
 $build = "$build.$branch" if $branch;
 
 # try to load the database
-if ($dsn && -e "$root/perl/DXSql.pm") {
-       require DXSql;
-       import DXSql;
-       
-       if (DXSql::init()) {
-               $dbh = DXSql->new($dsn);
-               $dbh = $dbh->connect($dsn, $dbuser, $dbpass) if $dbh;
-       }
+if (DXSql::init($dsn)) {
+       $dbh = DXSql->new($dsn);
+       $dbh = $dbh->connect($dsn, $dbuser, $dbpass) if $dbh;
 }
 
 # try to load XML::Simple
@@ -466,7 +451,6 @@ Spot->init();
 # initialise the protocol engine
 dbg("Start Protocol Engines ...");
 DXProt->init();
-Aranea->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));
@@ -517,12 +501,12 @@ for (;;) {
        
        # do timed stuff, ongoing processing happens one a second
        if ($timenow != $systime) {
-               reap if $zombies;
-               $systime = $timenow;
+               reap() if $zombies;
+               IsoTime::update($systime = $timenow);
                DXCron::process();      # do cron jobs
                DXCommandmode::process(); # process ongoing command mode stuff
+               DXXml::process();
                DXProt::process();              # process ongoing ak1a pcxx stuff
-               Aranea::process();
                DXConnect::process();
                DXMsg::process();
                DXDb::process();