aboutsummaryrefslogtreecommitdiff
path: root/azalea-client/src/plugins/connection.rs
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-10-12 23:01:54 +0300
committermat <git@matdoes.dev>2025-10-12 23:01:54 +0300
commitee2575794e91b9457a74a95daf1dcc707058cd58 (patch)
treedf725850ef18ded5ce3f6552e17095d0f704ae84 /azalea-client/src/plugins/connection.rs
parent1a1402954b07cd77615d0afc026c73b008787f51 (diff)
downloadazalea-drasl-ee2575794e91b9457a74a95daf1dcc707058cd58.tar.xz
upgrade deps and clean up lots of doc comments
Diffstat (limited to 'azalea-client/src/plugins/connection.rs')
-rw-r--r--azalea-client/src/plugins/connection.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/azalea-client/src/plugins/connection.rs b/azalea-client/src/plugins/connection.rs
index 5d9cde18..dc14545a 100644
--- a/azalea-client/src/plugins/connection.rs
+++ b/azalea-client/src/plugins/connection.rs
@@ -182,9 +182,10 @@ pub struct RawConnection {
pub(crate) is_alive: bool,
/// This exists for internal testing purposes and probably shouldn't be used
- /// for normal bots. It's basically a way to make our client think it
- /// received a packet from the server without needing to interact with the
- /// network.
+ /// for normal bots.
+ ///
+ /// It's basically a way to make our client think it received a packet from
+ /// the server without needing to interact with the network.
pub injected_clientbound_packets: Vec<Box<[u8]>>,
}
impl RawConnection {
@@ -305,9 +306,10 @@ pub struct NetworkConnection {
pub enc_cipher: Option<Aes128CfbEnc>,
pub writer_task: bevy_tasks::Task<()>,
- /// A queue of raw TCP packets to send. These will not be modified further,
- /// they should already be serialized and encrypted and everything before
- /// being added here.
+ /// A queue of raw TCP packets to send.
+ ///
+ /// These will not be modified further, they should already be serialized
+ /// and compressed and encrypted before being added here.
network_packet_writer_tx: mpsc::UnboundedSender<Box<[u8]>>,
}
impl NetworkConnection {
@@ -344,8 +346,9 @@ impl NetworkConnection {
trace!("Set compression threshold to {threshold:?}");
self.reader.compression_threshold = threshold;
}
- /// 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.
+ ///
+ /// The same key is used for both reading and writing.
pub fn set_encryption_key(&mut self, key: [u8; 16]) {
trace!("Enabled protocol encryption");
let (enc_cipher, dec_cipher) = azalea_crypto::create_cipher(&key);