use Time::HiRes qw(gettimeofday tv_interval);
use BadWords;
use DXHash;
+use Route::Node;
use strict;
use vars qw($me $pc11_max_age $pc23_max_age
do "$main::data/hop_table.pl" if -e "$main::data/hop_table.pl";
confess $@ if $@;
$me->{sort} = 'S'; # S for spider
+ $me->{priv} = 9;
+ $Route::Node::me->adddxchan($me);
}
#
$self->{lastping} = $main::systime + ($self->pingint / 2);
}
$self->state('init');
- $self->pc50_t(time);
+ $self->{pc50_t} = $main::systime;
# send info to all logged in thingies
$self->tell_login('loginn');
return;
}
}
+
+ my @spot = Spot::prepare($field[1], $field[2], $d, $field[5], $field[6], $field[7]);
+ # global spot filtering on INPUT
+ if ($self->{inspotsfilter}) {
+ my ($filter, $hops) = $self->{inspotsfilter}->it(@spot);
+ unless ($filter) {
+ dbg('chan', "PCPROT: Rejected by filter");
+ return;
+ }
+ }
- my @spot = Spot::add($field[1], $field[2], $d, $field[5], $field[6], $field[7]);
+ # add it
+ Spot::add(@spot);
#
# @spot at this point contains:-
next if $dxchan == $me;
# send a pc50 out on this channel
- if ($t >= $dxchan->pc50_t + $DXProt::pc50_interval) {
+ $dxchan->{pc50_t} = $main::systime unless exists $dxchan->{pc50_t};
+ if ($t >= $dxchan->{pc50_t} + $DXProt::pc50_interval) {
$dxchan->send(pc50(scalar DXChannel::get_all_users));
- $dxchan->pc50_t($t);
+ $dxchan->{pc50_t} = $t;
}
# send a ping out on this channel