diff options
| author | mat <git@matdoes.dev> | 2025-12-28 14:31:41 +0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-12-28 14:31:41 +0500 |
| commit | 7ab3b8924f64f7eadb6b8928b6fae73cb06e4c2f (patch) | |
| tree | 5add5d27fd7c2638ebe6fab9bd7adcdae28a358d /azalea/src/swarm | |
| parent | 9513f42e87f64c409cdb2a100500a50e5a713bac (diff) | |
| download | azalea-drasl-7ab3b8924f64f7eadb6b8928b6fae73cb06e4c2f.tar.xz | |
move Event and auto_reconnect to the azalea crate
Diffstat (limited to 'azalea/src/swarm')
| -rw-r--r-- | azalea/src/swarm/builder.rs | 7 | ||||
| -rw-r--r-- | azalea/src/swarm/mod.rs | 10 |
2 files changed, 7 insertions, 10 deletions
diff --git a/azalea/src/swarm/builder.rs b/azalea/src/swarm/builder.rs index 4eae7eab..860e47be 100644 --- a/azalea/src/swarm/builder.rs +++ b/azalea/src/swarm/builder.rs @@ -8,11 +8,7 @@ use std::{ time::Duration, }; -use azalea_client::{ - Account, DefaultPlugins, - auto_reconnect::{AutoReconnectDelay, DEFAULT_RECONNECT_DELAY}, - start_ecs_runner, -}; +use azalea_client::{Account, DefaultPlugins, start_ecs_runner}; use azalea_protocol::address::{ResolvableAddr, ResolvedAddr}; use azalea_world::InstanceContainer; use bevy_app::{App, AppExit, Plugins, SubApp}; @@ -24,6 +20,7 @@ use tracing::{debug, error, warn}; use crate::{ BoxHandleFn, HandleFn, JoinOpts, NoState, + auto_reconnect::{AutoReconnectDelay, DEFAULT_RECONNECT_DELAY}, bot::DefaultBotPlugins, swarm::{ BoxSwarmHandleFn, DefaultSwarmPlugins, NoSwarmState, Swarm, SwarmEvent, SwarmHandleFn, diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index c0f9cbca..48ac20a3 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -12,7 +12,7 @@ use std::sync::{ atomic::{self, AtomicBool}, }; -use azalea_client::{Account, Event, chat::ChatPacket, join::ConnectOpts}; +use azalea_client::{Account, chat::ChatPacket, join::ConnectOpts}; use azalea_entity::LocalEntity; use azalea_protocol::address::ResolvedAddr; use azalea_world::InstanceContainer; @@ -45,7 +45,7 @@ pub struct Swarm { pub instance_container: Arc<RwLock<InstanceContainer>>, /// This is used internally to make the client handler function work. - pub(crate) bots_tx: mpsc::UnboundedSender<(Option<Event>, Client)>, + pub(crate) bots_tx: mpsc::UnboundedSender<(Option<crate::Event>, Client)>, /// This is used internally to make the swarm handler function work. pub(crate) swarm_tx: mpsc::UnboundedSender<SwarmEvent>, } @@ -207,9 +207,9 @@ impl Swarm { /// Copy the events from a client's receiver into bots_tx, until the bot is /// removed from the ECS. async fn event_copying_task( - mut rx: mpsc::UnboundedReceiver<Event>, + mut rx: mpsc::UnboundedReceiver<crate::Event>, swarm_tx: mpsc::UnboundedSender<SwarmEvent>, - bots_tx: mpsc::UnboundedSender<(Option<Event>, Client)>, + bots_tx: mpsc::UnboundedSender<(Option<crate::Event>, Client)>, bot: Client, join_opts: JoinOpts, ) { @@ -246,7 +246,7 @@ impl Swarm { } } - if let Event::Disconnect(_) = event { + if let crate::Event::Disconnect(_) = event { debug!( "Sending SwarmEvent::Disconnect due to receiving an Event::Disconnect from client {}", bot.entity |
