From 567c6f4f2c39976d170111b816806453636f8241 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 1 May 2022 21:54:03 -0500 Subject: Reduce usage of AsyncRead We already receive everything from the server when it tells us the length, so we can actually just treat the stream as a Read instead of an AsyncRead. --- .../packets/handshake/client_intention_packet.rs | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) (limited to 'azalea-protocol/src/packets/handshake') diff --git a/azalea-protocol/src/packets/handshake/client_intention_packet.rs b/azalea-protocol/src/packets/handshake/client_intention_packet.rs index a92d65f6..6216ddc4 100755 --- a/azalea-protocol/src/packets/handshake/client_intention_packet.rs +++ b/azalea-protocol/src/packets/handshake/client_intention_packet.rs @@ -1,9 +1,7 @@ -use crate::{mc_buf::Writable, packets::ConnectionProtocol}; +use crate::packets::ConnectionProtocol; use packet_macros::HandshakePacket; use std::hash::Hash; -use super::HandshakePacket; - #[derive(Hash, Clone, Debug, HandshakePacket)] pub struct ClientIntentionPacket { #[varint] @@ -12,23 +10,3 @@ pub struct ClientIntentionPacket { pub port: u16, pub intention: ConnectionProtocol, } - -// impl ClientIntentionPacket { -// pub fn get(self) -> HandshakePacket { -// HandshakePacket::ClientIntentionPacket(self) -// } - -// pub fn write(&self, buf: &mut Vec) -> Result<(), std::io::Error> { -// buf.write_varint(self.protocol_version as i32)?; -// buf.write_utf(&self.hostname)?; -// buf.write_short(self.port as i16)?; -// buf.write_varint(self.intention as i32)?; -// Ok(()) -// } - -// pub async fn read( -// buf: &mut T, -// ) -> Result { -// todo!() -// } -// } -- cgit v1.2.3