aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src/packets/handshake
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-24 16:18:51 -0500
committermat <github@matdoes.dev>2022-04-24 16:18:51 -0500
commitb7641ff308aab7840d2a2253ae50f8ee496b2a97 (patch)
treef33eb83f119da5aae08f56a5c7543db15594b01d /azalea-protocol/src/packets/handshake
parent97d392f4e5721d8aa8940f253918965ff0b40348 (diff)
downloadazalea-drasl-b7641ff308aab7840d2a2253ae50f8ee496b2a97.tar.xz
1.18.2 support
Diffstat (limited to 'azalea-protocol/src/packets/handshake')
-rwxr-xr-xazalea-protocol/src/packets/handshake/client_intention_packet.rs24
1 files changed, 23 insertions, 1 deletions
diff --git a/azalea-protocol/src/packets/handshake/client_intention_packet.rs b/azalea-protocol/src/packets/handshake/client_intention_packet.rs
index 6216ddc4..a92d65f6 100755
--- a/azalea-protocol/src/packets/handshake/client_intention_packet.rs
+++ b/azalea-protocol/src/packets/handshake/client_intention_packet.rs
@@ -1,7 +1,9 @@
-use crate::packets::ConnectionProtocol;
+use crate::{mc_buf::Writable, packets::ConnectionProtocol};
use packet_macros::HandshakePacket;
use std::hash::Hash;
+use super::HandshakePacket;
+
#[derive(Hash, Clone, Debug, HandshakePacket)]
pub struct ClientIntentionPacket {
#[varint]
@@ -10,3 +12,23 @@ 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<u8>) -> 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<T: tokio::io::AsyncRead + std::marker::Unpin + std::marker::Send>(
+// buf: &mut T,
+// ) -> Result<HandshakePacket, String> {
+// todo!()
+// }
+// }