fix badspotters being able to send dx spots.
add LogDbg() routine to both log and dbg at the same time (at last).
1. Fixed problem with the standalone 'showdx' program pointed out by Leo,
IZ5FSA.
2. Fixed rounding problem on entering spots as pointed out by Ron N5IN.
1. Fixed problem with the standalone 'showdx' program pointed out by Leo,
IZ5FSA.
2. Fixed rounding problem on entering spots as pointed out by Ron N5IN.
+3. Fixed problem with badspotters sending DX as pointed out by Luigi IK5ZUK.
+4. Added some extra logging for swearing so that we can see what lines used
+which swear words. Hopefully this will allow sysops to refine their swearing
+filters more easily.
06Jan06=======================================================================
1. Fix problem with rcmd <call> sh/fdx
27Dec05=======================================================================
06Jan06=======================================================================
1. Fix problem with rcmd <call> sh/fdx
27Dec05=======================================================================
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
- Log('DXCommand', "$self->{call} swore: $line");
+ LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")");
Log('ann', $to, $from, "[to $from only] $line");
$self->send("To $to de $from <$t>: $line");
return (1, ());
Log('ann', $to, $from, "[to $from only] $line");
$self->send("To $to de $from <$t>: $line");
return (1, ());
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
- Log('DXCommand', "$self->{call} swore: $line");
+ LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")");
Log('chat', $target, $from, "[to $from only] $line");
return (1, "$target de $from <$t>: $line");
}
Log('chat', $target, $from, "[to $from only] $line");
return (1, "$target de $from <$t>: $line");
}
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
- Log('DXCommand', "$self->{call} swore: $line");
- $localonly++;
+ LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")");
+ $localonly++;
}
# do we have at least two args?
}
# do we have at least two args?
return (1, $self->msg('dx3'));
}
return (1, $self->msg('dx3'));
}
+# check some other things
+# remove ssid from calls
+my $callnoid = $self->call;
+$callnoid =~ s/-\d+$//;
+my $spotternoid = $spotter;
+$spotternoid =~ s/-\d+$//;
+if ($DXProt::baddx->in($spotted)) {
+ $localonly++;
+}
+if ($DXProt::badspotter->in($callnoid)) {
+ LogDbg('DXCommand', "$self->{call} badspotter with $callnoid ($line)");
+ $localonly++;
+}
+if ($callnoid ne $spotternoid && $DXProt::badspotter->in($spotternoid)) {
+ LogDbg('DXCommand', "$self->{call} badspotter with $spotternoid ($line)");
+ $localonly++;
+}
+
# make line the rest of the line
$line = $f[2] || " ";
@f = split /\s+/, $line;
# make line the rest of the line
$line = $f[2] || " ";
@f = split /\s+/, $line;
# Store it here (but only if it isn't baddx)
my $t = (int ($main::systime/60)) * 60;
# Store it here (but only if it isn't baddx)
my $t = (int ($main::systime/60)) * 60;
+return (1, $self->msg('dup')) if Spot::dup($freq, $spotted, $t, $line, $spotter);
my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall);
my @spot = Spot::prepare($freq, $spotted, $t, $line, $spotter, $main::mycall);
-my $thing = Thingy::Dx->new(user=>$spotter);
-$thing->from_DXProt(spotdata=>\@spot);
-if ($DXProt::baddx->in($spotted) || $freq =~ /^69/ || $localonly) {
+if ($freq =~ /^69/ || $localonly) {
# heaven forfend that we get a 69Mhz band :-)
if ($freq =~ /^69/) {
$self->badcount(($self->badcount||0) + 1);
}
# heaven forfend that we get a 69Mhz band :-)
if ($freq =~ /^69/) {
$self->badcount(($self->badcount||0) + 1);
}
+
+ $self->dx_spot(undef, undef, @spot);
+ return (1);
+ if (@spot) {
+ # store it
+ Spot::add(@spot);
+
+ # send orf to the users
+ DXProt::send_dx_spot($self, DXProt::pc11($spotter, $freq, $spotted, $line), @spot);
+ }
-push @out, $thing->gen_DXCommandmode($self);
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
my @bad;
if (@bad = BadWords::check($line)) {
$self->badcount(($self->badcount||0) + @bad);
- Log('DXCommand', "$self->{call} swore: $line");
+ LogDbg('DXCommand', "$self->{call} swore: $line (with words:" . join(',', @bad) . ")");
} else {
$dxchan->talk($self->call, $to, $via, $line) if $dxchan;
}
} else {
$dxchan->talk($self->call, $to, $via, $line) if $dxchan;
}
my @bad;
if (@bad = BadWords::check($cmdline)) {
$self->badcount(($self->badcount||0) + @bad);
my @bad;
if (@bad = BadWords::check($cmdline)) {
$self->badcount(($self->badcount||0) + @bad);
- Log('DXCommand', "$self->{call} swore: $cmdline");
+ LogDbg('DXCommand', "$self->{call} swore: $cmdline with words:" . join(',', @bad) . ")");
} else {
for (@{$self->{talklist}}) {
$self->send_talks($_, $rawline);
} else {
for (@{$self->{talklist}}) {
$self->send_talks($_, $rawline);
# check for excessive swearing
if ($self->{badcount} && $self->{badcount} >= $maxbadcount) {
# check for excessive swearing
if ($self->{badcount} && $self->{badcount} >= $maxbadcount) {
- Log('DXCommand', "$self->{call} logged out for excessive swearing");
+ LogDbg('DXCommand', "$self->{call} logged out for excessive swearing");
$self->disconnect;
return;
}
$self->disconnect;
return;
}
require Exporter;
@ISA = qw(Exporter);
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw(Log Logclose);
+@EXPORT = qw(Log LogDbg Logclose);
use IO::File;
use DXVars;
use IO::File;
use DXVars;
use strict;
use vars qw($VERSION $BRANCH);
use strict;
use vars qw($VERSION $BRANCH);
-main::mkver($VERSION = q$Revision$) if main->can('mkver');
+$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
+$main::build += $VERSION;
+$main::branch += $BRANCH;
$log->writeunix($t, join('^', $t, @_) );
}
$log->writeunix($t, join('^', $t, @_) );
}
+sub LogDbg
+{
+ DXDebug::dbg($_[$#_]);
+ Log(@_);
+}
+
sub Logclose
{
$log->close();
sub Logclose
{
$log->close();
use strict;
use vars qw($VERSION $BRANCH);
use strict;
use vars qw($VERSION $BRANCH);
-
-main::mkver($VERSION = q$Revision$);
+$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ );
+$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0));
+$main::build += $VERSION;
+$main::branch += $BRANCH;
use vars qw(%work @msg $msgdir %valid %busy $maxage $last_clean $residencetime
@badmsg @swop $swopfn $badmsgfn $forwardfn @forward $timeout $waittime
use vars qw(%work @msg $msgdir %valid %busy $maxage $last_clean $residencetime
@badmsg @swop $swopfn $badmsgfn $forwardfn @forward $timeout $waittime
}
# check the message for bad words
}
# check the message for bad words
+ @bad = BadWords::check($ref->{subject});
+ push @words, [$ref->{subject}, @bad] if @bad;
- push @words, BadWords::check($_);
+ @bad = BadWords::check($_);
+ push @words, [$_, @bad] if @bad;
- push @words, BadWords::check($ref->{subject});
- dbg("$ref->{from} swore: '@words' -> $ref->{to} '$ref->{subject}' origin: $ref->{origin} via " . $dxchan->call) if isdbg('msg');
- Log('msg',"$ref->{from} swore: '@words' -> $ref->{to} origin: $ref->{origin} via " . $dxchan->call);
+ dbg("$ref->{from} swore: $ref->{to} '$ref->{subject}' origin: $ref->{origin} via " . $dxchan->call) if isdbg('msg');
+ Log('msg',"$ref->{from} swore: $ref->{to} origin: $ref->{origin} via " . $dxchan->call);
+ dbg("subject: $ref->{subject}");
Log('msg',"subject: $ref->{subject}");
Log('msg',"subject: $ref->{subject}");
- for (@{$ref->{lines}}) {
- Log('msg', "line: $_");
+ for (@words) {
+ dbg("line: $_->[0] (using words: ". join(',',@{$_->[1]}).")");
+ Log('msg', "line: $_->[0] (using words: ". join(',',@{$_->[1]}).")");
}
$ref->stop_msg($fromnode);
return;
}
$ref->stop_msg($fromnode);
return;