mirror of https://github.com/pragma-/pbot.git
fix Net::IRC pacing
This commit is contained in:
parent
b585b161ca
commit
9b58f763e4
|
@ -1310,7 +1310,7 @@ sub schedule {
|
||||||
croak 'Second argument to schedule() isn\'t a coderef';
|
croak 'Second argument to schedule() isn\'t a coderef';
|
||||||
}
|
}
|
||||||
|
|
||||||
print STDERR "Scheduling event with time [$time]\n";
|
print STDERR "Scheduling event with time [$time]\n" if $self->{_debug};
|
||||||
$time += time;
|
$time += time;
|
||||||
$self->parent->enqueue_scheduled_event($time, $coderef, $self, @_);
|
$self->parent->enqueue_scheduled_event($time, $coderef, $self, @_);
|
||||||
}
|
}
|
||||||
|
@ -1327,7 +1327,7 @@ sub schedule_output_event {
|
||||||
croak 'Second argument to schedule() isn\'t a coderef';
|
croak 'Second argument to schedule() isn\'t a coderef';
|
||||||
}
|
}
|
||||||
|
|
||||||
print STDERR "Scheduling output event with time [$time]\n";
|
print STDERR "Scheduling output event with time [$time] [$_[0]]\n" if $self->{_debug};
|
||||||
$time += time;
|
$time += time;
|
||||||
$self->parent->enqueue_output_event($time, $coderef, $self, @_);
|
$self->parent->enqueue_output_event($time, $coderef, $self, @_);
|
||||||
}
|
}
|
||||||
|
@ -1392,7 +1392,9 @@ sub sl {
|
||||||
return $self->sl_real($line);
|
return $self->sl_real($line);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++$self->{_slcount} <= 8) {
|
if ($self->{_slcount} < 14) {
|
||||||
|
$self->{_slcount}++;
|
||||||
|
$self->{_lastsl} = time;
|
||||||
return $self->schedule_output_event(0, \&sl_real, $line);
|
return $self->schedule_output_event(0, \&sl_real, $line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1403,17 +1405,18 @@ sub sl {
|
||||||
} else {
|
} else {
|
||||||
$self->{_lastsl} += $self->pacing;
|
$self->{_lastsl} += $self->pacing;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $seconds = $self->{_lastsl} - $time;
|
my $seconds = $self->{_lastsl} - $time;
|
||||||
|
|
||||||
|
if ($seconds == 0) {
|
||||||
|
$self->{_slcount} = 0;
|
||||||
|
}
|
||||||
|
|
||||||
### DEBUG DEBUG DEBUG
|
### DEBUG DEBUG DEBUG
|
||||||
if ($self->{_debug}) {
|
if ($self->{_debug}) {
|
||||||
print STDERR "S-> $seconds $line\n";
|
print STDERR "S-> $seconds $line\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($seconds == 0) {
|
|
||||||
$self->{_slcount} = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
$self->schedule_output_event($seconds, \&sl_real, $line);
|
$self->schedule_output_event($seconds, \&sl_real, $line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue