diff options
| author | mat <github@matdoes.dev> | 2022-06-25 16:23:40 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-06-25 16:23:40 -0500 |
| commit | 460bdfb8bbaf0969df6451a00fc3de214728aec0 (patch) | |
| tree | bc88105b401bcfc27922e70227a89a8f1ac0259a /azalea-client/src/account.rs | |
| parent | 77980f0018eca3a192994021b76ad5d05bff88ea (diff) | |
| download | azalea-drasl-460bdfb8bbaf0969df6451a00fc3de214728aec0.tar.xz | |
merge ClientState and Client
Diffstat (limited to 'azalea-client/src/account.rs')
| -rw-r--r-- | azalea-client/src/account.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs index 56f4918a..32a46406 100644 --- a/azalea-client/src/account.rs +++ b/azalea-client/src/account.rs @@ -1,7 +1,8 @@ //! Connect to Minecraft servers. -use crate::Client; +use crate::{Client, Event}; use azalea_protocol::ServerAddress; +use tokio::sync::mpsc::UnboundedReceiver; /// Something that can join Minecraft servers. pub struct Account { @@ -14,7 +15,11 @@ impl Account { } } - pub async fn join(&self, address: &ServerAddress) -> Result<Client, String> { + /// Joins the Minecraft server on the given address using this account. + pub async fn join( + &self, + address: &ServerAddress, + ) -> Result<(Client, UnboundedReceiver<Event>), String> { Client::join(self, address).await } } |
