diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2022-04-25 03:50:17 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-25 03:50:17 +0000 |
| commit | dac943e3d79def7d2c322450790f16f027735941 (patch) | |
| tree | 3beafa3c8035c69a33b7d0f12779236bf786cf36 /azalea-protocol/src/packets/login/serverbound_hello_packet.rs | |
| parent | b7641ff308aab7840d2a2253ae50f8ee496b2a97 (diff) | |
| parent | f4dd3a9293367fa8f3d839a184e8055b22595204 (diff) | |
| download | azalea-drasl-dac943e3d79def7d2c322450790f16f027735941.tar.xz | |
Merge pull request #3 from mat-1/auth
Auth
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()) - } -} |
