From 271dadae0f85f0d3fd1c79ae438edbf2bee9e7ef Mon Sep 17 00:00:00 2001 From: Kyler <59854022+KylerOlsen@users.noreply.github.com> Date: Fri, 31 May 2024 16:28:47 -0600 Subject: [PATCH] Added constructor for ProtocolConnection --- src/mc_types.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mc_types.rs b/src/mc_types.rs index b2e11e5..c5bf232 100644 --- a/src/mc_types.rs +++ b/src/mc_types.rs @@ -62,6 +62,20 @@ pub struct ProtocolConnection<'a> { } impl<'a> ProtocolConnection<'a> { + pub fn new( + stream_read: &'a mut OwnedReadHalf, + stream_write: &'a mut OwnedWriteHalf, + ) -> Self { + ProtocolConnection { + stream_read, + stream_write, + rsa_private_key: None, + rsa_public_key: None, + aes_encryption_key: None, + verify_token: None, + } + } + pub async fn read_data(&mut self) -> Result> { match self.aes_encryption_key { Some(aes_key) => {