diff options
| author | mat <27899617+mat-1@users.noreply.github.com> | 2026-01-13 10:51:45 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 10:51:45 -0600 |
| commit | b21ac946cafaacc9ee2478ea48ed9e72554f79ed (patch) | |
| tree | 4d05744b9801e94f5da6563d8fabddfb20d1c7b7 /azalea-auth/src | |
| parent | d5fa5e32b37754b3b5c136e58821e48cd3b7c2ff (diff) | |
| download | azalea-drasl-b21ac946cafaacc9ee2478ea48ed9e72554f79ed.tar.xz | |
Merge AzaleaRead and AzaleaWrite (#305)
Diffstat (limited to 'azalea-auth/src')
| -rw-r--r-- | azalea-auth/src/game_profile.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/azalea-auth/src/game_profile.rs b/azalea-auth/src/game_profile.rs index 99af322d..ff456bc9 100644 --- a/azalea-auth/src/game_profile.rs +++ b/azalea-auth/src/game_profile.rs @@ -3,9 +3,7 @@ use std::{ sync::Arc, }; -use azalea_buf::{ - AzBuf, AzaleaRead, AzaleaReadLimited, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError, -}; +use azalea_buf::{AzBuf, AzBufLimited, AzBufVar, BufReadError}; use indexmap::IndexMap; use serde::{Deserialize, Serialize, Serializer}; use uuid::Uuid; @@ -53,7 +51,7 @@ impl From<SerializableGameProfile> for GameProfile { pub struct GameProfileProperties { pub map: IndexMap<String, ProfilePropertyValue>, } -impl AzaleaRead for GameProfileProperties { +impl AzBuf for GameProfileProperties { fn azalea_read(buf: &mut io::Cursor<&[u8]>) -> Result<Self, BufReadError> { let mut properties = IndexMap::new(); let properties_len = u32::azalea_read_var(buf)?; @@ -70,8 +68,6 @@ impl AzaleaRead for GameProfileProperties { } Ok(GameProfileProperties { map: properties }) } -} -impl AzaleaWrite for GameProfileProperties { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { (self.map.len() as u64).azalea_write_var(buf)?; for (key, value) in &self.map { @@ -87,14 +83,12 @@ pub struct ProfilePropertyValue { pub value: String, pub signature: Option<String>, } -impl AzaleaRead for ProfilePropertyValue { +impl AzBuf for ProfilePropertyValue { fn azalea_read(buf: &mut io::Cursor<&[u8]>) -> Result<Self, BufReadError> { let value = String::azalea_read_limited(buf, 32767)?; let signature = Option::<String>::azalea_read_limited(buf, 1024)?; Ok(ProfilePropertyValue { value, signature }) } -} -impl AzaleaWrite for ProfilePropertyValue { fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { self.value.azalea_write(buf)?; self.signature.azalea_write(buf)?; |
