From f7d361beca0caa4c2995ce9d3c6927a110d4adf5 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 10 Jul 2022 12:53:17 -0700 Subject: [PATCH] Core: show previous server:port if connecting without disconnecting --- lib/PBot/Core.pm | 4 +++- lib/PBot/VERSION.pm | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PBot/Core.pm b/lib/PBot/Core.pm index c97e7ea7..6eaf6f54 100644 --- a/lib/PBot/Core.pm +++ b/lib/PBot/Core.pm @@ -248,10 +248,12 @@ sub connect { $self->{logger}->log("Connecting to $server:$port\n"); if ($self->{conn}) { - $self->{logger}->log("Error: already connected to $server:$port!\n"); + $self->{logger}->log("Error: already connected to $self->{server}.\n"); return; } + $self->{server} = "$server:$port"; + for (my $attempt = 0; $attempt < $retries; $attempt++) { my %config = ( Nick => $self->{registry}->get_value('irc', 'randomize_nick') ? $self->random_nick : $self->{registry}->get_value('irc', 'botnick'), diff --git a/lib/PBot/VERSION.pm b/lib/PBot/VERSION.pm index 4683c195..bf1f228b 100644 --- a/lib/PBot/VERSION.pm +++ b/lib/PBot/VERSION.pm @@ -25,7 +25,7 @@ use PBot::Imports; # These are set by the /misc/update_version script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 4558, + BUILD_REVISION => 4559, BUILD_DATE => "2022-07-10", };