From cb4ade7710f6fa171130edeeabfa2db2fb1c526b Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Tue, 4 Aug 2020 00:13:58 +0200 Subject: fix endianness for CBTS_ERROR Otherwise the text will be garbled (reversed and probably cut short). --- src/event.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') 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 { 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::(raw_event.time).unwrap(); - cursor.write_u64::(raw_event.src_agent).unwrap(); - cursor.write_u64::(raw_event.dst_agent).unwrap(); - cursor.write_i32::(raw_event.value).unwrap(); - cursor.write_i32::(raw_event.buff_dmg).unwrap(); + cursor.write_u64::(raw_event.time).unwrap(); + cursor.write_u64::(raw_event.src_agent).unwrap(); + cursor.write_u64::(raw_event.dst_agent).unwrap(); + cursor.write_i32::(raw_event.value).unwrap(); + cursor.write_i32::(raw_event.buff_dmg).unwrap(); result } -- cgit v1.2.3