1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

Fix writing encrypted packets

This commit is contained in:
mat 2022-05-01 14:11:11 -05:00
parent 766b290065
commit 0ccf203460

View file

@ -65,10 +65,10 @@ pub async fn write_packet<P, W>(
if let Some(threshold) = compression_threshold {
buf = compression_encoder(&buf, threshold).await.unwrap();
}
buf = frame_prepender(&mut buf).unwrap();
// if we were given a cipher, encrypt the packet
if let Some(cipher) = cipher {
azalea_crypto::encrypt_packet(cipher, &mut buf);
}
buf = frame_prepender(&mut buf).unwrap();
stream.write_all(&buf).await.unwrap();
}