$to = 20 unless $to;
$from = 0 unless $from;
-@out = $self->spawn_cmd(\&DXLog::print, args => [$from, $to, $main::systime, 'ann', $who]);
+@out = $self->spawn_cmd("show/announce $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'ann', $who]);
#@out = DXLog::print($from, $to, $main::systime, 'ann', $who);
return (1, @out);
$to = 20 unless $to;
$from = 0 unless $from;
-@out = $self->spawn_cmd(\&DXLog::print, args => [$from, $to, $main::systime, 'chat', $who]);
+@out = $self->spawn_cmd("show/chat $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'chat', $who]);
#@out = DXLog::print($from, $to, $main::systime, 'chat', $who);
return (1, @out);
# now do the search
-push @out, $self->spawn_cmd(\&Spot::search,
+push @out, $self->spawn_cmd("sh/dx $line", \&Spot::search,
args => [$expr, $fromday, $today, $from, $to, $hint, $dofilter ? $self : undef],
cb => sub {
my ($dxchan, @res) = @_;
my @out;
$to = 500 unless $to;
- @out = $self->spawn_cmd(\&DXLog::print,
+ @out = $self->spawn_cmd("show/groups $to", \&DXLog::print,
args => [0, $to, $main::systime, 'chat', undef],
cb => sub {
my $self = shift;
$now = $now->sub($days);
$date = cldate($utime);
-@out = $self->spawn_cmd(sub {
+@out = $self->spawn_cmd("show/hfstats $line", sub {
my %list;
my @out;
my @in;
$date = cldate(time);
}
-@out = $self->spawn_cmd(sub {
+@out = $self->spawn_cmd("show/hftable $line", sub {
my %list;
my @out;
my $i;
use DB_File;
-@out = $self->spawn_cmd(sub {
+@out = $self->spawn_cmd("show/isolate $line", sub {
my @out;
my @val;
return (1, $self->msg('lockoutuse')) unless $line;
-@out = $self->spawn_cmd(sub {
+@out = $self->spawn_cmd("show lockout $line", sub {
my @out;
my @val;
my ($action, $count, $key, $data) = (0,0,0,0);
$who = $self->call;
}
- @out = $self->spawn_cmd(\&DXLog::print, args => [$from, $to, $main::systime, undef, $who]);
+ @out = $self->spawn_cmd("show/log $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, undef, $who]);
return (1, @out);
}
$to = 20 unless $to;
$from = 0 unless $from;
-@out = $self->spawn_cmd(\&DXLog::print, args => [$from, $to, $main::systime, 'rcmd', $who]);
+@out = $self->spawn_cmd("show/rcmd $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'rcmd', $who]);
#@out = DXLog::print($from, $to, $main::systime, 'rcmd', $who);
return (1, @out);
$line = "^\U\Q$line";
}
-@out = $self->spawn_cmd(sub {
+@out = $self->spawn_cmd("show/registered $line", sub {
my @out;
my @val;
return (1, $self->msg('e5')) if $who ne $self->call;
}
-@out = $self->spawn_cmd(\&DXLog::print, args => [$from, $to, $main::systime, 'talk', $who]);
+@out = $self->spawn_cmd("show/talk $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'talk', $who]);
#@out = DXLog::print($from, $to, $main::systime, 'talk', $who);
return (1, @out);
$now = $now->sub($days);
$date = cldate($utime);
-@out = $self->spawn_cmd(sub {
+@out = $self->spawn_cmd("show/vhfstats $line", sub {
my %list;
my @out;
my @in;
$date = cldate(time);
}
-@out = $self->spawn_cmd(sub {
+@out = $self->spawn_cmd("show/vhftable $line", sub {
my %list;
my @out;
my $i;
$to = 20 unless $to;
$from = 0 unless $from;
-@out = $self->spawn_cmd(\&DXLog::print, args => [$from, $to, $main::systime, 'ann', 'WX']);
+@out = $self->spawn_cmd("show/wx $cmdline", \&DXLog::print, args => [$from, $to, $main::systime, 'ann', 'WX']);
#@out = DXLog::print($from, $to, $main::systime, 'ann', $who);
return (1, @out);
{
return unless isdbg('chan');
my $call = shift;
- my $a = shift;
- my $b = shift || [gettimeofday];
- my $prefix = shift;
+ my $line = shift;
+ my $ta = shift;
+ my $tb = shift || [gettimeofday];
- my $secs = $b->[0] - $a->[0];
- my $msecs = int(($b->[1] - $a->[1]) / 1000);
+ my $a = int($ta->[0] * 1000) + int($ta->[1] / 1000);
+ my $b = int($tb->[0] * 1000) + int($tb->[1] / 1000);
+ my $msecs = $b - $a;
- my $s = "forkcall stats: $call ";
- $s .= "$prefix " if $prefix;
- $s .= "${secs}S" if $secs;
+ my $s = "forkcall stats: $call '$line' ";
$s .= "${msecs}mS";
dbg($s);
}
# IT DOES NOT START UP SOME NEW PROGRAM AND RELIES ON THE FACT THAT IT IS RUNNING DXSPIDER
# THE CURRENT CONTEXT!!
#
-# call: $self->spawn_cmd(\<function>, [cb => sub{...}], [prefix => "cmd> "], [progress => 0|1], [args => [...]]);
+# call: $self->spawn_cmd($original_cmd_line, \<function>, [cb => sub{...}], [prefix => "cmd> "], [progress => 0|1], [args => [...]]);
sub spawn_cmd
{
my $self = shift;
+ my $line = shift;
my $cmdref = shift;
my $call = $self->{call};
my %args = @_;
$dxchan->send(@res);
}
}
- _diffms($call, $t0, [gettimeofday], $prefix);
+ _diffms($call, $line, $t0);
});
return @out;