From 72e1a2327e2af7da54517a3df18f7b5599457b33 Mon Sep 17 00:00:00 2001 From: EightFactorial <29801334+EightFactorial@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:35:19 -0800 Subject: [PATCH] Clarify the reason the swarm can't connect --- azalea/src/swarm/mod.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 22b98a7e3..24b336fd5 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -671,7 +671,17 @@ impl Swarm { let delay = (Duration::from_secs(5) * 2u32.pow(disconnects.min(16))) .min(Duration::from_secs(15)); let username = account.username.clone(); - error!("Error joining as {username}: {e}. Waiting {delay:?} and trying again."); + + if let JoinError::Disconnect { reason } = &e { + error!( + "Error joining as {username}, server says: \"{reason}\". Waiting {delay:?} and trying again." + ); + } else { + error!( + "Error joining as {username}: {e}. Waiting {delay:?} and trying again." + ); + } + tokio::time::sleep(delay).await; } }