+14Feb23=======================================================================
+1. Attempt to be more M$ Windows compatible. This basically is to do with the
+ unfortunate fact that most of the Windows perl cannot do, or simulate
+ spawning (running another process in parallel) and/or Mojolicious cannot
+ handle coping with one or more versions of these simulations.
+
+ I don't have a windows perl available to me at moment so I can only
+ simulate running under windows by setting a variable.
+
+ You need to know that running any version of DXSpider on Windows will do
+ all long running commands in line. Much as the 'master' branch does. So
+ running large nodes on Windows boxes with versions of perl that do not
+ support running spawned processes continues to be contra-indicated. Much
+ as it has ALWAYS been.
04Feb23=======================================================================
1. Fixed sh/log so that callsigns beginning with a digit (or several) are
printed rather than being ignored.
}
Log('DXCommand', "nospawn '$line' by $mycall");
-$self->{_nospawn} = 1;
+++$self->{_nospawn};
my @out = $self->run_cmd($line);
-delete $self->{_nospawn};
+$self->{_nospawn} = 0 if exists $self->{_nospawn} && --$self->{_nospawn} <= 0;
return (1, @out);
}
open OF, "$app_req$fn" or return (1, $self->msg('e30', $fn));
for (@cmd) {
- $self->{_nospawn} = 1;
+ ++$self->{_nospawn};
print OF map {"$_\n"} $self->run_cmd($_);
- delete $self->{_nospawn};
+ $self->{_nospawn} = 0 if exists $self->{_nospawn} && --$self->{_nospawn} <= 0;
}
close OF;
return (1, $self->msg('ok'));
return (1, @out);
}
-return (1, DXLog::print($from, $to, $main::systime, 'ann', $who)) if $self->{_nospawn} || $DB::VERSION;
+return (1, DXLog::print($from, $to, $main::systime, 'ann', $who)) if ($self->{_nospawn} || $main::is_win == 1) || $DB::VERSION;
return (1, $self->spawn_cmd("show/announce $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'ann', $who]));
return (1, @out);
$to = 20 unless $to;
$from = 0 unless $from;
-if ($self->{_nospawn}) {
+if ($self->{_nospawn} || $main::is_win == 1) {
@out = DXLog::print($from, $to, $main::systime, 'chat', $who);
} else {
@out = $self->spawn_cmd("show/chat $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'chat', $who]);
# now do the search
- if ($self->{_nospawn} || ($Spot::spotcachedays && !$expr && $from == 0 && $fromday == 0 && $today == 0)) {
+ if (($self->{_nospawn} || $main::is_win == 1) || ($Spot::spotcachedays && !$expr && $from == 0 && $fromday == 0 && $today == 0)) {
my @res = Spot::search($expr, $fromday, $today, $from, $to, $user, $dofilter, $self);
my $ref;
my @dx;
}
$to = 500 unless $to;
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
return (1, doit($self, DXLog::print(undef, $to, $main::systime, 'chat', undef)));
}
return (1, $self->spawn_cmd("show/groups $to", \&DXLog::print, args => [0, $to, $main::systime, 'chat', undef], cb => \&doit));
# @out = $self->spawn_cmd("show/hfstats $line", sub {
# });
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
return (1, generate($self, $days, $now, $today));
}
else {
}
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
@out = generate($self);
} else {
@out = $self->spawn_cmd("show/hftable $line", sub { return (generate($self)); });
my @out;
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
return (1, generate($self));
} else {
return (1, $self->spawn_cmd("show/isolate $line", sub { return (generate($self)); }));
$who = $self->call;
}
- return (1, DXLog::print($from, $to, $main::systime, undef, $who)) if $self->{_nospawn};
+ return (1, DXLog::print($from, $to, $main::systime, undef, $who)) if ($self->{_nospawn} || $main::is_win == 1);
return (1, $self->spawn_cmd("show/log $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, undef, $who]));
}
$to = 20 unless $to;
$from = 0 unless $from;
-return (1, DXLog::print($from, $to, $main::systime, 'rcmd', $who)) if $self->{_nospawn};
+return (1, DXLog::print($from, $to, $main::systime, 'rcmd', $who)) if ($self->{_nospawn} || $main::is_win == 1);
return (1, $self->spawn_cmd("show/rcmd $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'rcmd', $who]));
$line = "\U\Q$line";
}
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
@out = generate($self, $line);
} else {
@out = $self->spawn_cmd("show/registered $line", sub { return (generate($self, $line)); });
$line = "\U\Q$line";
}
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
@out = generate($self, $line);
} else {
@out = $self->spawn_cmd("show/seeme $line", sub { return (generate($self, $line)); });
return (1, $self->msg('e5')) if $who ne $self->call;
}
-return (1, DXLog::print($from, $to, $main::systime, 'talk', $who)) if $self->{_nospawn};
+return (1, DXLog::print($from, $to, $main::systime, 'talk', $who)) if ($self->{_nospawn} || $main::is_win == 1);
return (1, $self->spawn_cmd("show/talk $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'talk', $who]));
# @out = $self->spawn_cmd("show/vhfstats $line", sub {
# });
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
return (1, generate($self, $days, $now, $today));
}
else {
$now = Julian::Day->new(time); #no starting date
$date = cldate(time);
}
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
@out = generate($self);
}
else {
$to = 20 unless $to;
$from = 0 unless $from;
-if ($self->{_nospawn}) {
+if ($self->{_nospawn} || $main::is_win == 1) {
@out = $self->spawn_cmd("show/wx $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'ann', 'WX']);
} else {
@out = DXLog::print($from, $to, $main::systime, 'ann', 'WX');
+++ /dev/null
-#
-# show/registered
-#
-# show all registered users
-#
-# Copyright (c) 2001 Dirk Koopman G1TLH
-#
-#
-#
-
-sub handle
-{
- my ($self, $line) = @_;
- return (1, $self->msg('e5')) unless $self->priv >= 9;
-
- my @out;
-
- use DB_File;
-
- if ($line) {
- $line =~ s/[^\w\-\/]+//g;
- $line = "\U\Q$line";
- }
-
- if ($self->{_nospawn}) {
- @out = generate($self, $line);
- } else {
- @out = $self->spawn_cmd("show/registered $line", sub { return (generate($self, $line)); });
- }
-
- return (1, @out);
-}
-
-sub generate
-{
- my $self = shift;
- my $line = shift;
- my @out;
- my @val;
-
-# dbg("set/register line: $line");
-
- my %call = ();
- $call{$_} = 1 for split /\s+/, $line;
- delete $call{'ALL'};
-
- my ($action, $count, $key, $data) = (0,0,0,0);
- unless (keys %call) {
- for ($action = DXUser::R_FIRST, $count = 0; !$DXUser::dbm->seq($key, $data, $action); $action = DXUser::R_NEXT) {
- if ($data =~ m{registered}) {
- $call{$key} = 1; # possible candidate
- }
- }
- }
-
- foreach $key (sort keys %call) {
- my $u = DXUser::get_current($key);
- if ($u && defined (my $r = $u->registered)) {
- push @val, "${key}($r)";
- ++$count;
- }
- }
-
- my @l;
- push @out, "Registration is " . ($main::reqreg ? "Required" : "NOT Required");
- foreach my $call (@val) {
- if (@l >= 5) {
- push @out, sprintf "%-14s %-14s %-14s %-14s %-14s", @l;
- @l = ();
- }
- push @l, $call;
- }
- if (@l) {
- push @l, "" while @l < 5;
- push @out, sprintf "%-14s %-14s %-14s %-14s %-14s", @l;
- }
-
- push @out, $self->msg('rec', $count);
- return @out;
-
-}
-
$self->{lang} = $main::lang if !$self->{lang};
$self->{func} = "";
$self->{width} ||= 80;
+ $self->{_nospawn} = 0;
# add in all the dxcc, itu, zone info
my @dxcc = Prefix::extract($call);
no strict 'refs';
# just behave normally if something has set the "one-shot" _nospawn in the channel
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
eval { @out = $cmdref->(@$args); };
if ($@) {
DXDebug::dbgprintring(25);
sub {
my ($fc, $err, @res) = @_;
--$main::me->{_nospawn};
- delete $main::me->{_nospawn} if exists $main::me->{_nospawn} && $main::me->{_nospawn} <= 0;
+ $main::me->{_nospawn} = 0 if exists $main::me->{_nospawn} && $main::me->{_nospawn} <= 0;
if ($err) {
my $s = "DXCron::spawn_cmd: error $err";
dbg($s);
use Julian;
-our $readback = 1;
+our $readback = $main::is_win ? 0 : 1;
if ($readback) {
$readback = `which tac`;
}
my $fc = DXSubprocess->new;
# just behave normally if something has set the "one-shot" _nospawn in the channel
- if ($self->{_nospawn}) {
+ if ($self->{_nospawn} || $main::is_win == 1) {
eval { @out = $cmdref->(@$args); };
if ($@) {
DXDebug::dbgprintring(25);
our $spotcachedays = 2; # default 2 days worth
our $minselfspotqrg = 1240000; # minimum freq above which self spotting is allowed
-our $readback = 1;
+our $readback = $main::is_win ? 0 : 1;
if ($readback) {
$readback = `which tac`;