Dirk Koopman [Wed, 17 Aug 2016 15:24:01 +0000 (16:24 +0100)]
fix various issues
1. Make cluster.lck checking consistent and accurate.
2. Fix export_user actions to always put them in local_data.
3. Fix create_prefix.pl output file and input file searching. Basically
this now looks for cty.dat and wpxloc.raw in local_data first and then
falls backs to data. But puts the result in local_data unless the
--system flag is set.
Dirk Koopman [Tue, 16 Aug 2016 23:46:27 +0000 (00:46 +0100)]
move ganerated stuff to local_data
Mega change to push all local data in $root/local_data and where there
is duplication with system data (still in $root/data) then use whichever
is newer. This will move stuff (permanently) like spots and other DXLog
files to local_data as well as the userfile, DX QSL file and usdb stuff.
It appears that perl 5.10.1 has "issues" with Storable freeze/thaw
and, as we aren't doing anything clever with Mojo::IOLoop::Forkcall
in DXCommandmode, we will use JSON instead.
Dirk Koopman [Fri, 20 Jun 2014 13:42:27 +0000 (14:42 +0100)]
Some more optimisations
Process input directly after receipt.
Do the most common case of input processing first!
Don't autoflush things like debug files automatically but do it
in periodic processing every second (for now).
Dirk Koopman [Sat, 8 Mar 2014 00:18:18 +0000 (00:18 +0000)]
fix small crash with Spot::dup
This may have something to do with the new wpxloc.raw format that
I am now using (erm.. testing). But if I check for a a duplicate of
the prefix in the remarks, and that "prefix" (char string length <= 4)
contains a space, Spot::dup crashes. Intermittently.
Dirk Koopman [Sun, 12 Jan 2014 17:59:50 +0000 (17:59 +0000)]
improve the previous fix for import_cmd slightly
Make sure that if a Route::Node disappears and the software clucks
in broadcast_pc92_update/broadcast_pc92_keepalive then STILL update
the timer so that it doesn't continue to cluck every 10 seconds.
Convert sh/wm7d command to AsyncMsg.
Modify all the HTTPMsg converted cmds to use AsyncMsg.
Add a 'raw' 'telnet' handler. This allows one to query things with command
prompts or stuff that isn't a HTTP server. But it ain't always easy. See the
messing around in sh/wm7d I had to do, to get something that is stable given
that the thing that I am looking doesn't have a \n at the end.
Traditionally, a command is a piece of perl that is a simple
in line lump of code e.g (blank.pl):
my ($self, $line) = @_;
my $lines = 1;
my $data = ' ';
my @f = split /\s+/, $line;
if (@f && $f[0] !~ /^\d+$/) {
$data = shift @f;
$data = $data x int(($self->width-1) / length($data));
$data .= substr $data, 0, int(($self->width-1) % length($data))
}
if (@f && $f[0] =~ /^\d+$/) {
$lines = shift @f;
$lines = 9 if $lines > 9;
$lines = 1 if $lines < 1;
}
my @out;
push @out, $data for (1..$lines);
return (1, @out);
It is now possible to have a 'handler' and any other code you like in
a command file, for instance (again blank.pl):
sub this {}
sub that {}
sub another {}
sub handle
{
my ($self, $line) = @_;
my $lines = 1;
my $data = ' ';
my @f = split /\s+/, $line;
if (@f && $f[0] !~ /^\d+$/) {
$data = shift @f;
$data = $data x int(($self->width-1) / length($data));
$data .= substr $data, 0, int(($self->width-1) % length($data))
}
if (@f && $f[0] =~ /^\d+$/) {
$lines = shift @f;
$lines = 9 if $lines > 9;
$lines = 1 if $lines < 1;
}
my @out;
push @out, $data for (1..$lines);
return (1, @out);
}
The 'sub handle' being the cue that distiguishes one form from the other.
The first form has the 'sub handle { <code> }' wrapped around it so, internally
they are treated the same. Each command is placed in its own DXCommandmode sub
package with a standard set of packages "use"d in front of it.
For now (at least) any functions you declare are just that. "$self" is a DXCommandmode
not a blessed reference to this command's full package name, you cannot use things like