3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

PBot: do not connect if env PBOT_LOCAL is true

This commit is contained in:
Pragmatic Software 2020-07-11 17:38:24 -07:00
parent d9947d364c
commit bbf4eddba9

View File

@ -278,6 +278,7 @@ sub random_nick {
# TODO: add disconnect subroutine
sub connect {
my ($self, $server) = @_;
return if $ENV{PBOT_LOCAL};
if ($self->{connected}) {
# TODO: disconnect, clean-up, etc
@ -333,15 +334,15 @@ sub connect {
#main loop
sub do_one_loop {
my $self = shift;
$self->{irc}->do_one_loop();
$self->{select_handler}->do_select();
$self->{irc}->do_one_loop() if $self->{connected};
$self->{select_handler}->do_select;
}
sub start {
my $self = shift;
while (1) {
$self->connect() if not $self->{connected};
$self->do_one_loop() if $self->{connected};
$self->connect if not $self->{connected};
$self->do_one_loop;
}
}