diff --git a/Cargo.lock b/Cargo.lock index 60db64e..ebd2f74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3212,7 +3212,7 @@ dependencies = [ [[package]] name = "shaysbot" -version = "0.8.3" +version = "0.8.4" dependencies = [ "anyhow", "azalea", diff --git a/Cargo.toml b/Cargo.toml index 7c65324..6228f31 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shaysbot" -version = "0.8.3" +version = "0.8.4" authors = ["Shayne Hartford "] edition = "2021" description = "My personal Minecraft bot using Azalea" diff --git a/src/plugins/auto_exit.rs b/src/plugins/auto_exit.rs index 7c216a0..a6a1a75 100644 --- a/src/plugins/auto_exit.rs +++ b/src/plugins/auto_exit.rs @@ -33,6 +33,7 @@ pub fn handle_auto_exit_disconnect_event( mut events: EventReader, mut query: Query<&GameProfileComponent>, swarm_state: Res, + settings: Res, ) { for event in events.read() { let Ok(game_profile) = query.get_mut(event.entity) else { @@ -43,7 +44,7 @@ pub fn handle_auto_exit_disconnect_event( continue; }; - if reason.to_string().starts_with("AutoDisconnect") { + if settings.zenith_auto_disconnect && reason.to_string().starts_with("AutoDisconnect") { info!("[AutoReconnect] Disabled for {}", game_profile.name); swarm_state .auto_reconnect diff --git a/src/settings.rs b/src/settings.rs index a17832c..70c8550 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -50,6 +50,10 @@ pub struct Settings { #[default(false)] pub unknown_player_auto_exit: bool, + /// Automatically disconnect and exit Zenith Proxy disconnects the bot. + #[default(false)] + pub zenith_auto_disconnect: bool, + /// Disable in-game commands for non-whitelisted players. #[default(false)] pub whitelist: bool,