From 5a9fca0ca9cdb46f4b866781f219756c89e2293a Mon Sep 17 00:00:00 2001 From: mat <27899617+mat-1@users.noreply.github.com> Date: Sat, 6 Aug 2022 07:22:19 +0000 Subject: Better errors (#14) * make reading use thiserror * finish implementing all the error things * clippy warnings related to ok_or * fix some errors in other places * thiserror in more places * don't use closures in a couple places * errors in writing packet * rip backtraces * change some BufReadError::Custom to UnexpectedEnumVariant * Errors say what packet is bad * error on leftover data and fix it wasn't reading the properties for gameprofile --- azalea-auth/src/game_profile.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'azalea-auth/src') diff --git a/azalea-auth/src/game_profile.rs b/azalea-auth/src/game_profile.rs index d75f60a4..333f926f 100755 --- a/azalea-auth/src/game_profile.rs +++ b/azalea-auth/src/game_profile.rs @@ -1,12 +1,12 @@ +use azalea_buf::McBuf; use std::collections::HashMap; - use uuid::Uuid; -#[derive(Clone, Debug)] +#[derive(McBuf, Debug, Clone)] pub struct GameProfile { pub uuid: Uuid, pub name: String, - pub properties: HashMap, + pub properties: HashMap, } impl GameProfile { @@ -18,3 +18,9 @@ impl GameProfile { } } } + +#[derive(McBuf, Debug, Clone)] +pub struct ProfilePropertyValue { + pub value: String, + pub signature: Option, +} -- cgit v1.2.3