unshift @INC, "$root/perl"; # this IS the right way round!
unshift @INC, "$root/local";
unshift @INC, "$root/perl"; # this IS the right way round!
unshift @INC, "$root/local";
die "The directory $root doesn't exist, please RTFM" unless -d $root;
die "$root/local doesn't exist, please RTFM" unless -d "$root/local";
die "$root/local/DXVars.pm doesn't exist, please RTFM" unless -e "$root/local/DXVars.pm";
die "The directory $root doesn't exist, please RTFM" unless -d $root;
die "$root/local doesn't exist, please RTFM" unless -d "$root/local";
die "$root/local/DXVars.pm doesn't exist, please RTFM" unless -e "$root/local/DXVars.pm";
-use vars qw(@inqueue $systime $version $starttime $lockfn @outstanding_connects
- $zombies $root @listeners $lang $myalias @debug $userfn $clusteraddr
+use vars qw(@inqueue $systime $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 $do_xml $systime_days $systime_daystart
$clusterport $mycall $decease $is_win $routeroot $me $reqreg $bumpexisting
$allowdxby $dbh $dsn $dbuser $dbpass $do_xml $systime_days $systime_daystart
);
@inqueue = (); # the main input queue, an array of hashes
$systime = 0; # the time now (in seconds)
);
@inqueue = (); # the main input queue, an array of hashes
$systime = 0; # the time now (in seconds)
-$version = "1.53"; # the version no of the software
-$starttime = 0; # the starting time of the cluster
-#@outstanding_connects = (); # list of outstanding connects
+$starttime = 0; # the starting time of the cluster
+@outstanding_connects = (); # list of outstanding connects
@listeners = (); # list of listeners
$reqreg = 0; # 1 = registration required, 2 = deregister people
$bumpexisting = 1; # 1 = allow new connection to disconnect old, 0 - don't allow it
$allowdxby = 0; # 1 = allow "dx by <othercall>", 0 - don't allow it
@listeners = (); # list of listeners
$reqreg = 0; # 1 = registration required, 2 = deregister people
$bumpexisting = 1; # 1 = allow new connection to disconnect old, 0 - don't allow it
$allowdxby = 0; # 1 = allow "dx by <othercall>", 0 - don't allow it
# send a message to call on conn and disconnect
sub already_conn
{
my ($conn, $call, $mess) = @_;
$conn->disable_read(1);
# send a message to call on conn and disconnect
sub already_conn
{
my ($conn, $call, $mess) = @_;
$conn->disable_read(1);
if ($user) {
$user->{lang} = $main::lang if !$user->{lang}; # to autoupdate old systems
} else {
$user = DXUser->new($call);
}
if ($user) {
$user->{lang} = $main::lang if !$user->{lang}; # to autoupdate old systems
} else {
$user = DXUser->new($call);
}
#
#############################################################
$starttime = $systime = time;
$systime_days = int ($systime / 86400);
#
#############################################################
$starttime = $systime = time;
$systime_days = int ($systime / 86400);
# try to load the database
if (DXSql::init($dsn)) {
$dbh = DXSql->new($dsn);
$dbh = $dbh->connect($dsn, $dbuser, $dbpass) if $dbh;
}
# try to load the database
if (DXSql::init($dsn)) {
$dbh = DXSql->new($dsn);
$dbh = $dbh->connect($dsn, $dbuser, $dbpass) if $dbh;
}
DXUser->init($userfn, 1);
# look for the sysop and the alias user and complain if they aren't there
DXUser->init($userfn, 1);
# look for the sysop and the alias user and complain if they aren't there
$conn = $pkg->new_server($l->[0], $l->[1], \&{"${pkg}::${login}"});
$conn->conns("Server $l->[0]/$l->[1] using ${pkg}::${login}");
push @listeners, $conn;
$conn = $pkg->new_server($l->[0], $l->[1], \&{"${pkg}::${login}"});
$conn->conns("Server $l->[0]/$l->[1] using ${pkg}::${login}");
push @listeners, $conn;
$SIG{PIPE} = sub { dbg("Broken PIPE signal received"); };
$SIG{IO} = sub { dbg("SIGIO received"); };
$SIG{WINCH} = $SIG{STOP} = $SIG{CONT} = 'IGNORE';
$SIG{PIPE} = sub { dbg("Broken PIPE signal received"); };
$SIG{IO} = sub { dbg("SIGIO received"); };
$SIG{WINCH} = $SIG{STOP} = $SIG{CONT} = 'IGNORE';
# 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));
# 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));
# make sure that there is a routing OUTPUT node default file
#unless (Filter::read_in('route', 'node_default', 0)) {
# make sure that there is a routing OUTPUT node default file
#unless (Filter::read_in('route', 'node_default', 0)) {
# do timed stuff, ongoing processing happens one a second
if ($timenow != $systime) {
reap() if $zombies;
# do timed stuff, ongoing processing happens one a second
if ($timenow != $systime) {
reap() if $zombies;