diff options
| author | mat <github@matdoes.dev> | 2022-04-24 19:28:29 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-24 19:28:29 -0500 |
| commit | 4c00bd886578c70f6aeb35400d9d03b355df3155 (patch) | |
| tree | f4903dd0b8f9690a6c52a180babd56d12c3926c0 /azalea-protocol/src/packets/login/serverbound_hello_packet.rs | |
| parent | 3e507f0db4020eaf406ba69aae3d4dc1301d29ac (diff) | |
| download | azalea-drasl-4c00bd886578c70f6aeb35400d9d03b355df3155.tar.xz | |
Add ServerboundKeyPacket
Diffstat (limited to 'azalea-protocol/src/packets/login/serverbound_hello_packet.rs')
| -rwxr-xr-x | azalea-protocol/src/packets/login/serverbound_hello_packet.rs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/azalea-protocol/src/packets/login/serverbound_hello_packet.rs b/azalea-protocol/src/packets/login/serverbound_hello_packet.rs index a72480f2..eb6a4065 100755 --- a/azalea-protocol/src/packets/login/serverbound_hello_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_hello_packet.rs @@ -1,27 +1,7 @@ +use packet_macros::LoginPacket; use std::hash::Hash; -use crate::mc_buf::Writable; - -use super::LoginPacket; - -#[derive(Hash, Clone, Debug)] +#[derive(Hash, Clone, Debug, LoginPacket)] pub struct ServerboundHelloPacket { pub username: String, } - -impl ServerboundHelloPacket { - pub fn get(self) -> LoginPacket { - LoginPacket::ServerboundHelloPacket(self) - } - - pub fn write(&self, buf: &mut Vec<u8>) -> Result<(), std::io::Error> { - buf.write_utf(&self.username).unwrap(); - Ok(()) - } - - pub async fn read<T: tokio::io::AsyncRead + std::marker::Unpin + std::marker::Send>( - _buf: &mut T, - ) -> Result<LoginPacket, String> { - Err("ServerboundHelloPacket::read not implemented".to_string()) - } -} |
