From 9a7d544a120feb80fc0455f1eb23ddc5a7c20ad8 Mon Sep 17 00:00:00 2001 From: Sakuhl <2012collector@gmail.com> Date: Sat, 14 Mar 2020 15:47:44 +0100 Subject: [PATCH] Expose more API data --- src/lib.rs | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2dae93e..b7ae547 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -133,7 +133,7 @@ pub struct Player { pub meta: PlayerMetadata, pub classes: Vec, pub guild: PlayerGuildInfo, - pub global: Value, + pub global: GlobalPlayerInfo, pub ranking: Value } @@ -142,23 +142,36 @@ pub struct Player { pub struct PlayerMetadata { pub firstJoin: String, pub lastJoin: String, - pub location: Value, + pub location: Location, pub playtime: u64, pub tag: Value, pub veteran: bool } +#[derive(Debug, Deserialize)] +pub struct Location { + pub online: bool, + pub server: Option +} + #[derive(Debug, Deserialize)] pub struct GlobalPlayerInfo { - pub items_identified: u64, - pub mobs_killed: u64, - pub pvp_kills: u64, - pub pvp_deaths: u64, - pub chests_found: u64, - pub blocks_walked: u64, + pub chestsFound: u64, + pub blocksWalked: u64, + pub itemsIdentified: u64, + pub mobsKilled: u64, + pub totalLevel: Value, + pub pvp: Pvp, pub logins: u64, pub deaths: u64, - pub total_level: u64 + pub discoveries: u64, + pub eventsWon: u64 +} + +#[derive(Debug, Deserialize)] +pub struct Pvp { + pub kills: u64, + pub deaths: u64 } #[derive(Debug, Deserialize)]