diff options
Diffstat (limited to 'azalea-protocol')
| -rw-r--r-- | azalea-protocol/src/connect.rs | 52 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/config/mod.rs | 2 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/game/mod.rs | 2 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/handshake/mod.rs | 2 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/login/mod.rs | 2 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/mod.rs | 2 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/status/mod.rs | 2 |
7 files changed, 30 insertions, 34 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 5268554d..78ad6d81 100644 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -68,18 +68,13 @@ pub struct WriteConnection<W: ProtocolPacket> { /// Join an offline-mode server and go through the handshake. /// ```rust,no_run /// use azalea_protocol::{ -/// resolver, /// connect::Connection, /// packets::{ -/// self, -/// ClientIntention, PROTOCOL_VERSION, -/// login::{ -/// ClientboundLoginPacket, -/// ServerboundHello, -/// ServerboundKey -/// }, -/// handshake::ServerboundIntention -/// } +/// self, ClientIntention, PROTOCOL_VERSION, +/// handshake::ServerboundIntention, +/// login::{ClientboundLoginPacket, ServerboundHello, ServerboundKey}, +/// }, +/// resolver, /// }; /// /// #[tokio::main] @@ -93,7 +88,8 @@ pub struct WriteConnection<W: ProtocolPacket> { /// hostname: resolved_address.ip().to_string(), /// port: resolved_address.port(), /// intention: ClientIntention::Login, -/// }).await?; +/// }) +/// .await?; /// /// let mut conn = conn.login(); /// @@ -101,7 +97,8 @@ pub struct WriteConnection<W: ProtocolPacket> { /// conn.write(ServerboundHello { /// name: "bot".to_string(), /// profile_id: uuid::Uuid::nil(), -/// }).await?; +/// }) +/// .await?; /// /// let (conn, game_profile) = loop { /// let packet = conn.read().await?; @@ -112,7 +109,8 @@ pub struct WriteConnection<W: ProtocolPacket> { /// conn.write(ServerboundKey { /// key_bytes: e.encrypted_public_key, /// encrypted_challenge: e.encrypted_challenge, -/// }).await?; +/// }) +/// .await?; /// conn.set_encryption_key(e.secret_key); /// } /// ClientboundLoginPacket::LoginCompression(p) => { @@ -402,19 +400,20 @@ impl Connection<ClientboundLoginPacket, ServerboundLoginPacket> { /// /// ```rust,no_run /// use azalea_auth::AuthResult; - /// use azalea_protocol::connect::Connection; - /// use azalea_protocol::packets::login::{ - /// ClientboundLoginPacket, - /// ServerboundKey + /// use azalea_protocol::{ + /// connect::Connection, + /// packets::login::{ClientboundLoginPacket, ServerboundKey}, /// }; /// use uuid::Uuid; /// # use azalea_protocol::ServerAddress; /// /// # async fn example() -> Result<(), Box<dyn std::error::Error>> { - /// let AuthResult { access_token, profile } = azalea_auth::auth( - /// "example@example.com", - /// azalea_auth::AuthOpts::default() - /// ).await.expect("Couldn't authenticate"); + /// let AuthResult { + /// access_token, + /// profile, + /// } = azalea_auth::auth("example@example.com", azalea_auth::AuthOpts::default()) + /// .await + /// .expect("Couldn't authenticate"); /// # /// # let address = ServerAddress::try_from("example@example.com").unwrap(); /// # let resolved_address = azalea_protocol::resolver::resolve_address(&address).await?; @@ -428,16 +427,13 @@ impl Connection<ClientboundLoginPacket, ServerboundLoginPacket> { /// ClientboundLoginPacket::Hello(p) => { /// // tell Mojang we're joining the server & enable encryption /// let e = azalea_crypto::encrypt(&p.public_key, &p.challenge).unwrap(); - /// conn.authenticate( - /// &access_token, - /// &profile.id, - /// e.secret_key, - /// &p - /// ).await?; + /// conn.authenticate(&access_token, &profile.id, e.secret_key, &p) + /// .await?; /// conn.write(ServerboundKey { /// key_bytes: e.encrypted_public_key, /// encrypted_challenge: e.encrypted_challenge, - /// }).await?; + /// }) + /// .await?; /// conn.set_encryption_key(e.secret_key); /// } /// _ => {} diff --git a/azalea-protocol/src/packets/config/mod.rs b/azalea-protocol/src/packets/config/mod.rs index ab1c1a78..e7aea8fd 100644 --- a/azalea-protocol/src/packets/config/mod.rs +++ b/azalea-protocol/src/packets/config/mod.rs @@ -1,4 +1,4 @@ -// NOTE: This file is generated automatically by codegen/packet.py. +// NOTE: This file is @generated automatically by codegen/packet.py. // Don't edit it directly! use azalea_protocol_macros::declare_state_packets; diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index aae840bc..eb73b9de 100644 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -1,4 +1,4 @@ -// NOTE: This file is generated automatically by codegen/packet.py. +// NOTE: This file is @generated automatically by codegen/packet.py. // Don't edit it directly! use azalea_protocol_macros::declare_state_packets; diff --git a/azalea-protocol/src/packets/handshake/mod.rs b/azalea-protocol/src/packets/handshake/mod.rs index 79dc583d..8f14c8fb 100644 --- a/azalea-protocol/src/packets/handshake/mod.rs +++ b/azalea-protocol/src/packets/handshake/mod.rs @@ -1,4 +1,4 @@ -// NOTE: This file is generated automatically by codegen/packet.py. +// NOTE: This file is @generated automatically by codegen/packet.py. // Don't edit it directly! use azalea_protocol_macros::declare_state_packets; diff --git a/azalea-protocol/src/packets/login/mod.rs b/azalea-protocol/src/packets/login/mod.rs index 5e0a0433..39f1565b 100644 --- a/azalea-protocol/src/packets/login/mod.rs +++ b/azalea-protocol/src/packets/login/mod.rs @@ -1,4 +1,4 @@ -// NOTE: This file is generated automatically by codegen/packet.py. +// NOTE: This file is @generated automatically by codegen/packet.py. // Don't edit it directly! use azalea_protocol_macros::declare_state_packets; diff --git a/azalea-protocol/src/packets/mod.rs b/azalea-protocol/src/packets/mod.rs index 5e654491..773ce591 100644 --- a/azalea-protocol/src/packets/mod.rs +++ b/azalea-protocol/src/packets/mod.rs @@ -101,4 +101,4 @@ impl AzaleaWrite for ClientIntention { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { (*self as i32).azalea_write_var(buf) } -} +}
\ No newline at end of file diff --git a/azalea-protocol/src/packets/status/mod.rs b/azalea-protocol/src/packets/status/mod.rs index 6af51369..57ed9970 100644 --- a/azalea-protocol/src/packets/status/mod.rs +++ b/azalea-protocol/src/packets/status/mod.rs @@ -1,4 +1,4 @@ -// NOTE: This file is generated automatically by codegen/packet.py. +// NOTE: This file is @generated automatically by codegen/packet.py. // Don't edit it directly! use azalea_protocol_macros::declare_state_packets; |
