07Mar23=======================================================================
1. Fix odd (and old) regression dx command (line ending 59+++) '++' being the
culprit.
+2. Allow multiple commands on one line when separated with the 2 character
+ string '\n' (sigh).
+3. Move a few init things about on startup so that more parameters are
+ scriptable.
+4. Put some debug comments before loading various caches (that might take a
+ longgggg time) and then tell people how long each cache load took. This
+ should reduce the worry that something is "wrong" when there is a delay
+ (such as searching for announces).
06Mar23=======================================================================
1. Fix filter error reporting, including incrementing concurrent error count
if there are actually any detected parse errors.
use DXDupe;
use DXLog;
use DXLogPrint;
+use Time::HiRes qw(gettimeofday tv_interval);
use vars qw(%dup $duplth $dupage $filterdef);
sub init
{
+ my $t0 = [gettimeofday];
+ dbg("AnnTalk: loading up to $maxcache announcements into cache");
@anncache = DXLog::search(0, $maxcache, $main::systime, 'ann');
shift @anncache while @anncache > $maxcache;
my $l = @anncache;
- dbg("AnnTalk: loaded last $l announcements into cache");
+ dbg("AnnTalk: loaded last $l announcements into cache in " . _diffms($t0) . "mS");
}
sub add_anncache
}
$self->state('prompt');
delete $self->{talklist};
- } elsif ($cmdline =~ m|^/+\w+|) {
+ } elsif ($cmdline =~ m|^[/\w\\]+|) {
$cmdline =~ s|^/||;
my $sendit = $cmdline =~ s|^/+||;
if (@bad = BadWords::check($cmdline)) {
$self->badcount(($self->badcount||0) + @bad);
LogDbg('DXCommand', "$self->{call} swore: '$cmdline' with badwords: '" . join(',', @bad) . "'");
} else {
- my @in = $self->run_cmd($cmdline);
- $self->send_ans(@in);
- if ($sendit && $self->{talklist} && @{$self->{talklist}}) {
- foreach my $l (@in) {
- for (@{$self->{talklist}}) {
- if ($self->{state} eq 'talk') {
- $self->send_talks($_, $l);
- } else {
- send_chats($self, $_, $l)
+ my @cmd = split /\s*\\n\s*/, $cmdline;
+ foreach my $l (@cmd) {
+ my @in = $self->run_cmd($l);
+ $self->send_ans(@in);
+ if ($sendit && $self->{talklist} && @{$self->{talklist}}) {
+ foreach my $l (@in) {
+ for (@{$self->{talklist}}) {
+ if ($self->{state} eq 'talk') {
+ $self->send_talks($_, $l);
+ }
+ else {
+ send_chats($self, $_, $l)
+ }
}
}
}
# if (@bad = BadWords::check($cmdline)) {
# $self->badcount(($self->badcount||0) + @bad);
# LogDbg('DXCommand', "$self->{call} swore: '$cmdline' with badwords: '" . join(',', @bad) . "'");
-# } else {
- $self->send_ans(run_cmd($self, $cmdline));
+ # } else {
+ my @cmd = split /\s*\\n\s*/, $cmdline;
+ foreach my $l (@cmd) {
+ $self->send_ans(run_cmd($self, $l));
+ }
# }
}
use IO::File;
use DXDebug;
use DXDupe;
+use Time::HiRes qw(gettimeofday tv_interval);
use strict;
$fp = DXLog::new('wwv', 'dat', 'm');
do "$param" if -e "$param";
# read in existing data
+ my $t0 = [gettimeofday];
+ dbg(sprintf "WWV read in upto %d records into cache", $maxcache);
@cache = readfile($main::systime);
shift @cache while @cache > $maxcache;
- dbg(sprintf "WWV read in last %d records into cache", scalar @cache);
+ dbg(sprintf "WWV read in last %d records into cache in %dmS", scalar @cache, _diffms($t0));
confess $@ if $@;
}
use IO::File;
use DXDebug;
use Data::Dumper;
+use Time::HiRes qw(gettimeofday tv_interval);
use strict;
$fp = DXLog::new('wcy', 'dat', 'm');
do "$param" if -e "$param";
# read in existing data
+ my $t0 = [gettimeofday];
@cache = readfile($main::systime);
shift @cache while @cache > $maxcache;
- dbg(sprintf "WCY read in last %d records into cache", scalar @cache);
+ dbg(sprintf "WCY read in last %d records into cache %dmS", scalar @cache, _diffms($t0));
confess $@ if $@;
}
Filter::init(); # doesn't do much, but has to be done
- AnnTalk::init(); # initialise announce cache
-
-
# look for the sysop and the alias user and complain if they aren't there
{
dbg("Read in Aliases");
CmdAlias->init();
- # initialise the Geomagnetic data engine
- dbg("Start WWV");
- Geomag->init();
- dbg("Start WCY");
- WCY->init();
-
# initialise the protocol engine
dbg("Start Protocol Engines ...");
DXProt->init();
my $script = new Script "startup";
$script->run($main::me) if $script;
+
+ # initialise the Geomagnetic data engine
+ dbg("Start WWV");
+ Geomag->init();
+ dbg("Start WCY");
+ WCY->init();
+ AnnTalk::init(); # initialise announce cache
+
+
# 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);