mirror of
https://github.com/eigenein/wotbreplay-parser.git
synced 2026-10-21 10:27:01 +02:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d601082d6 | ||
|
|
632f1781e7 |
No files matched your search
+3
-3
@@ -6,10 +6,10 @@ pub enum Error {
|
||||
ZipError(#[from] zip::result::ZipError),
|
||||
|
||||
#[error("Protocol Buffers error")]
|
||||
DecodeFailed(#[from] prost::DecodeError),
|
||||
ProtobufError(#[from] prost::DecodeError),
|
||||
|
||||
#[error("Pickle error")]
|
||||
UnpickleFailed(#[from] serde_pickle::Error),
|
||||
PickleError(#[from] serde_pickle::Error),
|
||||
|
||||
#[error("I/O error")]
|
||||
IoError(#[from] std::io::Error),
|
||||
@@ -19,7 +19,7 @@ pub enum Error {
|
||||
|
||||
#[cfg(feature = "meta")]
|
||||
#[error("JSON error")]
|
||||
JsonDecodeFailed(#[from] serde_json::Error),
|
||||
JsonError(#[from] serde_json::Error),
|
||||
|
||||
#[error("invalid magic: {0:#X}, expected: {1:#X}")]
|
||||
InvalidMagic(u32, u32),
|
||||
|
||||
@@ -8,7 +8,7 @@ use crate::result::Result;
|
||||
#[derive(Debug, Serialize)]
|
||||
pub enum EntityMethod {
|
||||
/// TODO: team composition.
|
||||
Subtype2F,
|
||||
Subtype2F(#[serde_as(as = "serde_with::hex::Hex")] Vec<u8>),
|
||||
|
||||
/// Default variant when subtype is not known.
|
||||
Unknown {
|
||||
@@ -28,7 +28,7 @@ impl EntityMethod {
|
||||
let sub_type = reader.read_u32::<LittleEndian>()?;
|
||||
|
||||
let this = match sub_type {
|
||||
0x2F => Self::Subtype2F,
|
||||
0x2F => Self::Subtype2F(payload),
|
||||
_ => Self::Unknown { sub_type, payload },
|
||||
};
|
||||
Ok(this)
|
||||
|
||||
@@ -23,7 +23,7 @@ pub struct Summary {
|
||||
pub camouflage_slot: u8,
|
||||
|
||||
#[serde(rename(deserialize = "avgMmr"))]
|
||||
pub average_mmr: Vec<f64>,
|
||||
pub average_mmr: Vec<Option<f64>>,
|
||||
|
||||
#[serde(rename(deserialize = "playerWaitTimes"))]
|
||||
pub player_wait_times: HashMap<u32, f64>,
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ fn data_ok() -> Result<()> {
|
||||
assert!(header.summary.is_mouse_enabled);
|
||||
assert_eq!(header.summary.matchmaker_type, 2);
|
||||
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!(
|
||||
header.summary.account_database_ids,
|
||||
[
|
||||
|
||||
BIN
Binary file not shown.
Reference in new issue
Block a user