From 11b8dcdf3f02085c1a14cf870f55a7b85a8796f7 Mon Sep 17 00:00:00 2001 From: Mettwasser <68561341+Mettwasser@users.noreply.github.com> Date: Sun, 23 Jun 2024 17:57:04 +0200 Subject: [PATCH] fix: syndicate jobs now have the type fix: added missing faction, cleaned up factions --- src/worldstate/models/arbitration.rs | 12 +++++- src/worldstate/models/faction.rs | 3 +- src/worldstate/models/mission_type.rs | 46 +++++++++++----------- src/worldstate/models/syndicate_mission.rs | 6 ++- 4 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/worldstate/models/arbitration.rs b/src/worldstate/models/arbitration.rs index fcb82f2..c8f1c6f 100644 --- a/src/worldstate/models/arbitration.rs +++ b/src/worldstate/models/arbitration.rs @@ -45,7 +45,17 @@ mod test { match client.fetch::().await { Ok(_arbitration) => Ok(()), - Err(why) => Err(why), + Err(why) => { + if let ApiError::ApiError(error) = why { + if error.code == 404 { + Ok(()) + } else { + Err(ApiError::ApiError(error)) + } + } else { + Err(why) + } + } } } diff --git a/src/worldstate/models/faction.rs b/src/worldstate/models/faction.rs index 6222bc6..c162d58 100644 --- a/src/worldstate/models/faction.rs +++ b/src/worldstate/models/faction.rs @@ -11,5 +11,6 @@ enum_builder! { Tenno, Narmer, Crossfire, - Murmur = "The Murmur" + Murmur = "The Murmur", + ManInTheWall = "FC_MITW" } diff --git a/src/worldstate/models/mission_type.rs b/src/worldstate/models/mission_type.rs index 9a45cad..676647f 100644 --- a/src/worldstate/models/mission_type.rs +++ b/src/worldstate/models/mission_type.rs @@ -1,44 +1,46 @@ use super::macros::enum_builder; enum_builder! { + :"A Mission Type in Warframe" MissionType; AncientRetribution = "Ancient Retribution", - Arena = "Arena", - Assassination = "Assassination", - Assault = "Assault", - Capture = "Capture", - Conclave = "Conclave", + Arena, + Assassination, + Assault, + Capture, + Conclave, DarkSectorDefection = "Dark Sector Defection", DarkSectorDefense = "Dark Sector Defense", DarkSectorDisruption = "Dark Sector Disruption", DarkSectorExcavation = "Dark Sector Excavation", DarkSectorSabotage = "Dark Sector Sabotage", DarkSectorSurvival = "Dark Sector Survival", - Defense = "Defense", - Disruption = "Disruption", - Excavation = "Excavation", + Defense, + Disruption, + Excavation, ExterminationArchwing = "Extermination (Archwing)", - Extermination = "Extermination", + Extermination, FreeRoam = "Free Roam", - Hijack = "Hijack", - Hive = "Hive", + Hijack, + Hive, HiveSabotage = "Hive Sabotage", - Interception = "Interception", + Interception, InterceptionArchwing = "Interception (Archwing)", MobileDefense = "Mobile Defense", MobileDefenseArchwing = "Mobile Defense (Archwing)", OrokinSabotage = "Orokin Sabotage", - Orphix = "Orphix", + Orphix, PursuitArchwing = "Pursuit (Archwing)", - Relay = "Relay", - Rescue = "Rescue", + Relay, + Rescue, RushArchwing = "Rush (Archwing)", - Sabotage = "Sabotage", + Sabotage, SabotageArchwing = "Sabotage (Archwing)", - Skirmish = "Skirmish", - Spy = "Spy", - Survival = "Survival", - Volatile = "Volatile", - Alchemy = "Alchemy", - Corruption = "Corruption", + Skirmish, + Spy, + Survival, + Volatile, + Alchemy, + Corruption, VoidCascade = "Void Cascade", + Defection } diff --git a/src/worldstate/models/syndicate_mission.rs b/src/worldstate/models/syndicate_mission.rs index b7f3c10..384c456 100644 --- a/src/worldstate/models/syndicate_mission.rs +++ b/src/worldstate/models/syndicate_mission.rs @@ -14,6 +14,8 @@ model_builder! { :"The Reward Pool of the Bounty" pub reward_pool: Vec, + :"The type (or name) of the syndicate job" + pub job_type: String = "type", :"The level of the Enemies in this job" pub enemy_levels: Vec, @@ -25,11 +27,11 @@ model_builder! { pub minimum_mr: i32 = "minMR", :"Expiry when this mission expires/disappears" - expiry: DateTime + pub expiry: DateTime } model_builder! { - :"Warning: This is extremly janky -- All Syndicate Missions (including Cetus, etc.)\nNote that they *may* be empty, in which case they are not valid." + :"All Syndicate Missions (including Cetus, etc.)\nNote that they *may* be empty, in which case they are not valid." SyndicateMission: "/syndicateMissions", rt = array, timed = true;