Compare commits

..
5 changed files with 7 additions and 7 deletions

No files matched your search

+3 -3
View File
@@ -6,10 +6,10 @@ pub enum Error {
ZipError(#[from] zip::result::ZipError), ZipError(#[from] zip::result::ZipError),
#[error("Protocol Buffers error")] #[error("Protocol Buffers error")]
DecodeFailed(#[from] prost::DecodeError), ProtobufError(#[from] prost::DecodeError),
#[error("Pickle error")] #[error("Pickle error")]
UnpickleFailed(#[from] serde_pickle::Error), PickleError(#[from] serde_pickle::Error),
#[error("I/O error")] #[error("I/O error")]
IoError(#[from] std::io::Error), IoError(#[from] std::io::Error),
@@ -19,7 +19,7 @@ pub enum Error {
#[cfg(feature = "meta")] #[cfg(feature = "meta")]
#[error("JSON error")] #[error("JSON error")]
JsonDecodeFailed(#[from] serde_json::Error), JsonError(#[from] serde_json::Error),
#[error("invalid magic: {0:#X}, expected: {1:#X}")] #[error("invalid magic: {0:#X}, expected: {1:#X}")]
InvalidMagic(u32, u32), InvalidMagic(u32, u32),
+2 -2
View File
@@ -8,7 +8,7 @@ use crate::result::Result;
#[derive(Debug, Serialize)] #[derive(Debug, Serialize)]
pub enum EntityMethod { pub enum EntityMethod {
/// TODO: team composition. /// TODO: team composition.
Subtype2F, Subtype2F(#[serde_as(as = "serde_with::hex::Hex")] Vec<u8>),
/// Default variant when subtype is not known. /// Default variant when subtype is not known.
Unknown { Unknown {
@@ -28,7 +28,7 @@ impl EntityMethod {
let sub_type = reader.read_u32::<LittleEndian>()?; let sub_type = reader.read_u32::<LittleEndian>()?;
let this = match sub_type { let this = match sub_type {
0x2F => Self::Subtype2F, 0x2F => Self::Subtype2F(payload),
_ => Self::Unknown { sub_type, payload }, _ => Self::Unknown { sub_type, payload },
}; };
Ok(this) Ok(this)
+1 -1
View File
@@ -23,7 +23,7 @@ pub struct Summary {
pub camouflage_slot: u8, pub camouflage_slot: u8,
#[serde(rename(deserialize = "avgMmr"))] #[serde(rename(deserialize = "avgMmr"))]
pub average_mmr: Vec<f64>, pub average_mmr: Vec<Option<f64>>,
#[serde(rename(deserialize = "playerWaitTimes"))] #[serde(rename(deserialize = "playerWaitTimes"))]
pub player_wait_times: HashMap<u32, f64>, pub player_wait_times: HashMap<u32, f64>,
+1 -1
View File
@@ -22,7 +22,7 @@ fn data_ok() -> Result<()> {
assert!(header.summary.is_mouse_enabled); assert!(header.summary.is_mouse_enabled);
assert_eq!(header.summary.matchmaker_type, 2); assert_eq!(header.summary.matchmaker_type, 2);
assert_eq!(header.summary.camouflage_slot, 1); assert_eq!(header.summary.camouflage_slot, 1);
assert_eq!(header.summary.average_mmr, [59.29457753400008, 99.34182121604681]); assert_eq!(header.summary.average_mmr, [Some(59.29457753400008), Some(99.34182121604681)]);
assert_eq!( assert_eq!(
header.summary.account_database_ids, header.summary.account_database_ids,
[ [