diff options
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | src/event.rs | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d8c0124..c7c6b4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ All notable changes to this project will be documented in this file. ## Unreleased +### Fixed +- Fixed the conversion from `CBTS_ERROR` to `EventKind::Error` not having the + correct text. ## 0.4.0 - 2020-07-24 ### Added diff --git a/src/event.rs b/src/event.rs index d0d3181..f9ee8e5 100644 --- a/src/event.rs +++ b/src/event.rs @@ -6,7 +6,7 @@ use super::raw; use std::convert::TryFrom; use std::io; -use byteorder::{BigEndian, WriteBytesExt}; +use byteorder::{BigEndian, WriteBytesExt, LE}; use getset::{CopyGetters, Getters}; use num_traits::FromPrimitive; use thiserror::Error; @@ -515,11 +515,11 @@ fn get_api_guild_string(bytes: &[u8; 16]) -> Option<String> { fn get_error_bytes(raw_event: &raw::CbtEvent) -> [u8; 32] { let mut result = [0; 32]; let mut cursor = io::Cursor::new(&mut result as &mut [u8]); - cursor.write_u64::<BigEndian>(raw_event.time).unwrap(); - cursor.write_u64::<BigEndian>(raw_event.src_agent).unwrap(); - cursor.write_u64::<BigEndian>(raw_event.dst_agent).unwrap(); - cursor.write_i32::<BigEndian>(raw_event.value).unwrap(); - cursor.write_i32::<BigEndian>(raw_event.buff_dmg).unwrap(); + cursor.write_u64::<LE>(raw_event.time).unwrap(); + cursor.write_u64::<LE>(raw_event.src_agent).unwrap(); + cursor.write_u64::<LE>(raw_event.dst_agent).unwrap(); + cursor.write_i32::<LE>(raw_event.value).unwrap(); + cursor.write_i32::<LE>(raw_event.buff_dmg).unwrap(); result } |