aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/connect.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-12-08 18:39:35 -0600
committermat <github@matdoes.dev>2022-12-08 18:39:35 -0600
commit70e2dfed16da8d5130460ea15b47701e622f4a9f (patch)
tree41f670baf3a05ed180880ec2a11d8e5f6a1a1599 /azalea-protocol/src/connect.rs
parentf2076daba5cfcce81399b075ba9258fbdc2012fa (diff)
downloadazalea-drasl-70e2dfed16da8d5130460ea15b47701e622f4a9f.tar.xz
wrap_comments = true
Diffstat (limited to 'azalea-protocol/src/connect.rs')
-rwxr-xr-xazalea-protocol/src/connect.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs
index b21572e3..48401d03 100755
--- a/azalea-protocol/src/connect.rs
+++ b/azalea-protocol/src/connect.rs
@@ -226,12 +226,14 @@ impl Connection<ClientboundHandshakePacket, ServerboundHandshakePacket> {
})
}
- /// Change our state from handshake to login. This is the state that is used for logging in.
+ /// Change our state from handshake to login. This is the state that is used
+ /// for logging in.
pub fn login(self) -> Connection<ClientboundLoginPacket, ServerboundLoginPacket> {
Connection::from(self)
}
- /// Change our state from handshake to status. This is the state that is used for pinging the server.
+ /// Change our state from handshake to status. This is the state that is
+ /// used for pinging the server.
pub fn status(self) -> Connection<ClientboundStatusPacket, ServerboundStatusPacket> {
Connection::from(self)
}
@@ -252,14 +254,16 @@ impl Connection<ClientboundLoginPacket, ServerboundLoginPacket> {
}
}
- /// Set the encryption key that is used to encrypt and decrypt packets. It's the same for both reading and writing.
+ /// Set the encryption key that is used to encrypt and decrypt packets. It's
+ /// the same for both reading and writing.
pub fn set_encryption_key(&mut self, key: [u8; 16]) {
let (enc_cipher, dec_cipher) = azalea_crypto::create_cipher(&key);
self.reader.dec_cipher = Some(dec_cipher);
self.writer.enc_cipher = Some(enc_cipher);
}
- /// Change our state from login to game. This is the state that's used when you're actually in the game.
+ /// Change our state from login to game. This is the state that's used when
+ /// you're actually in the game.
pub fn game(self) -> Connection<ClientboundGamePacket, ServerboundGamePacket> {
Connection::from(self)
}
@@ -342,7 +346,8 @@ where
R1: ProtocolPacket + Debug,
W1: ProtocolPacket + Debug,
{
- /// Creates a `Connection` of a type from a `Connection` of another type. Useful for servers or custom packets.
+ /// Creates a `Connection` of a type from a `Connection` of another type.
+ /// Useful for servers or custom packets.
pub fn from<R2, W2>(connection: Connection<R1, W1>) -> Connection<R2, W2>
where
R2: ProtocolPacket + Debug,