experimental branch to improve spot query
[spider.git] / perl / cluster.pl
index 07fd6ab594630c0606a48bae4932f3abf38e4d2d..4c0f374c3eca9bfc54304b4826bef353bb851bab 100755 (executable)
@@ -253,16 +253,16 @@ sub new_channel
                }
 
                # is he locked out ?
+               my $lock;
                $user = DXUser::get_current($call);
                $conn->conns($call);
                my $basecall = $call;
-               $basecall =~ s/-\d+$//; # remember this for later multiple user processing
-               my $lock;
+               $basecall =~ s/-\d+$//; # remember this for later multiple user processing, it's used for other stuff than checking lockout status
                if ($user) {
                        # make sure we act on any locked status that the actual incoming call has.
                        $lock = $user->lockout;
-               } elsif ($allowmultiple && $call ne $basecall) {
-                   # if we are allowing multiple connections and there is a basecall minus incoming ssid, use the basecall's lock status
+               } elsif ($basecall ne $call) {
+                       # if there isn't a SSID on the $call, then try the base
                        $user = DXUser::get_current($basecall);
                        $lock = $user->lockout if $user;
                }
@@ -660,26 +660,23 @@ sub setup_start
        dbg("Start WCY");
        WCY->init();
 
-       # initial the Spot stuff
-       dbg("Starting DX Spot system");
-       Spot->init();
-
        # initialise the protocol engine
        dbg("Start Protocol Engines ...");
        DXProt->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->do_pc9x(1);
-       $routeroot->via_pc92(1);
-
        # make sure that there is a routing OUTPUT node default file
        #unless (Filter::read_in('route', 'node_default', 0)) {
        #       my $dxcc = $main::me->dxcc;
        #       $Route::filterdef->cmd($main::me, 'route', 'accept', "node_default call $mycall" );
        #}
 
-       # read in any existing message headers and clean out old crap
+       my $script = new Script "startup";
+    $script->run($main::me) if $script;
+
+       # initial the Spot stuff
+       dbg("Starting DX Spot system");
+       Spot->init();   #
+       
        dbg("reading existing message headers ...");
        DXMsg->init();
        DXMsg::clean_old();
@@ -708,8 +705,6 @@ sub setup_start
 
        # this, such as it is, is the main loop!
        dbg("orft we jolly well go ...");
-       my $script = new Script "startup";
-       $script->run($main::me) if $script;
 
        #open(DB::OUT, "|tee /tmp/aa");
 }
@@ -749,7 +744,7 @@ sub idle_loop
                        $main::me->disconnect;
                }
 
-               Mojo::IOLoop->stop if --$ending <= 0;
+               Mojo::IOLoop->stop_gracefully if --$ending <= 0;
        }
 }