From: minima Date: Wed, 31 Dec 2003 20:04:16 +0000 (+0000) Subject: add Thingy X-Git-Tag: R1_51~1 X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=1284d2e7cc4c25bb02c7f4fa7c59246de9c0027c add Thingy --- diff --git a/perl/Thingy.pm b/perl/Thingy.pm new file mode 100644 index 00000000..cf057957 --- /dev/null +++ b/perl/Thingy.pm @@ -0,0 +1,50 @@ +# +# Thingy handling +# +# This is the new fundamental protocol engine handler +# +# $Id$ +# +# Copyright (c) 2004 Dirk Koopman G1TLH +# + +package Thingy; + +use vars qw($VERSION $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; + + +use DXChannel; +use DXDebug; + +our @queue; + +# we expect all thingies to be subclassed +sub new +{ + my $class = shift; + my $self = {@_}; + + bless $self, $class; + return $self; +} + +# add the Thingy to the queue +sub add +{ + push @queue, shift; +} + +# dispatch Thingies to action it. +sub process +{ + my $t = pop @queue if @queue; + + $t->process if $t; +} + +1; + diff --git a/perl/cluster.pl b/perl/cluster.pl index 6d4dc90f..62227d21 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -99,6 +99,7 @@ use Mrtg; use USDB; use UDPMsg; use QSL; +use Thingy; use Data::Dumper; use IO::File; @@ -126,7 +127,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 += 5; # 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; @@ -558,7 +559,10 @@ for (;;) { 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 };