projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branches 'mojo' and 'test' of ssh://server/scm/spider into test
[spider.git]
/
perl
/
RBN.pm
diff --git
a/perl/RBN.pm
b/perl/RBN.pm
index 9d17d33bddfd597bf6318f0e1b2ec263d2f0cf8d..4c28575365fee363b478e5cce3fcbd4c1e338ee4 100644
(file)
--- a/
perl/RBN.pm
+++ b/
perl/RBN.pm
@@
-172,9
+172,9
@@
sub start
my $name = $user->{name};
# log it
my $name = $user->{name};
# log it
- my $host = $self->{conn}->peerhost;
-
$host ||= "unknown"
;
- $self->{hostname} = $host;
+ unless ($self->{hostname}) {
+
$self->{hostname} = $self->{conn}->peerhost || 'unknown'
;
+ }
$self->{name} = $name ? $name : $call;
$self->state('prompt'); # a bit of room for further expansion, passwords etc
$self->{name} = $name ? $name : $call;
$self->state('prompt'); # a bit of room for further expansion, passwords etc
@@
-194,7
+194,7
@@
sub start
$self->{width} = 80 unless $self->{width} && $self->{width} > 80;
$self->{consort} = $line; # save the connection type
$self->{width} = 80 unless $self->{width} && $self->{width} > 80;
$self->{consort} = $line; # save the connection type
- LogDbg('
DXCommand
', "$call connected from $self->{hostname}");
+ LogDbg('
err
', "$call connected from $self->{hostname}");
# set some necessary flags on the user if they are connecting
$self->{registered} = 1;
# set some necessary flags on the user if they are connecting
$self->{registered} = 1;
@@
-202,11
+202,10
@@
sub start
$self->{priv} = 0;
# get the filters
$self->{priv} = 0;
# get the filters
- my $nossid = $call;
-
$nossid =~ s/-\d+$//
;
+# $self->{inrbnfilter} = Filter::read_in('rbn', $call, 1)
+
# || Filter::read_in('rbn', 'node_default', 1)
;
- $self->{inrbnfilter} = Filter::read_in('rbn', $call, 1)
- || Filter::read_in('rbn', 'node_default', 1);
+ Filter::load_dxchan($self, 'rbn', 1);
# clean up qra locators
my $qra = $user->qra;
# clean up qra locators
my $qra = $user->qra;
@@
-259,6
+258,14
@@
sub normal
return;
}
return;
}
+ # is it 'baddx'
+ if ($DXProt::baddx->in($call)) {
+ dbg("RBN: Bad DX spot '$call', ignored");
+ dbg($line) if isdbg('nologchan');
+ return;
+ }
+
+
# remove all extraneous crap from the origin - just leave the base callsign
my $norigin = basecall($origin);
unless ($norigin) {
# remove all extraneous crap from the origin - just leave the base callsign
my $norigin = basecall($origin);
unless ($norigin) {
@@
-361,7
+368,7
@@
sub normal
dbg("seeme: result '$buf'") if isdbg('seeme');
$uchan->local_send('S', $buf);
} else {
dbg("seeme: result '$buf'") if isdbg('seeme');
$uchan->local_send('S', $buf);
} else {
- LogDbg("RBN Someone is playing silly persons $rcall is not a user and cannot do 'seeme', ignored and reset");
+ LogDbg(
'err',
"RBN Someone is playing silly persons $rcall is not a user and cannot do 'seeme', ignored and reset");
del_seeme($rcall);
}
}
del_seeme($rcall);
}
}
@@
-844,7
+851,7
@@
sub per_minute
next unless $dxchan->is_rbn;
dbg "RBN:STATS minute $dxchan->{call} raw: $dxchan->{noraw} retrieved spots: $dxchan->{norbn} delivered: $dxchan->{nospot} after filtering to users: " . scalar keys %{$dxchan->{nousers}} if isdbg('rbnstats');
if ($dxchan->{noraw} == 0 && $dxchan->{lasttime} > 60) {
next unless $dxchan->is_rbn;
dbg "RBN:STATS minute $dxchan->{call} raw: $dxchan->{noraw} retrieved spots: $dxchan->{norbn} delivered: $dxchan->{nospot} after filtering to users: " . scalar keys %{$dxchan->{nousers}} if isdbg('rbnstats');
if ($dxchan->{noraw} == 0 && $dxchan->{lasttime} > 60) {
- LogDbg('
RBN
', "RBN: no input from $dxchan->{call}, disconnecting");
+ LogDbg('
err
', "RBN: no input from $dxchan->{call}, disconnecting");
$dxchan->disconnect;
}
$dxchan->{noraw} = $dxchan->{norbn} = $dxchan->{nospot} = 0; $dxchan->{nousers} = {};
$dxchan->disconnect;
}
$dxchan->{noraw} = $dxchan->{norbn} = $dxchan->{nospot} = 0; $dxchan->{nousers} = {};
@@
-900,7
+907,10
@@
sub finish
sub write_cache
{
sub write_cache
{
+ return unless $json;
+
my $ta = [ gettimeofday ];
my $ta = [ gettimeofday ];
+
$json->indent(1)->canonical(1) if isdbg 'rbncache';
my $s = eval {$json->encode($spots)};
if ($s) {
$json->indent(1)->canonical(1) if isdbg 'rbncache';
my $s = eval {$json->encode($spots)};
if ($s) {
@@
-980,7
+990,7
@@
sub del_seeme
my $call = shift;
my $base = basecall($call);
my $ref = $seeme{$base};
my $call = shift;
my $base = basecall($call);
my $ref = $seeme{$base};
- return unless @$ref;
+ return unless
$ref &&
@$ref;
@$ref = grep {$_ ne $call} @$ref;
if (@$ref) {
@$ref = grep {$_ ne $call} @$ref;
if (@$ref) {