diff options
author | Daniel Schadt <kingdread@gmx.de> | 2020-12-11 22:02:53 +0100 |
---|---|---|
committer | Daniel Schadt <kingdread@gmx.de> | 2020-12-11 22:02:53 +0100 |
commit | 7bf28dc7b3df4d8663c97bedadbfb09f48e9db39 (patch) | |
tree | b2511862af5d5b758ff69f230a3fad45858de72b /src/event.rs | |
parent | 172c17db58f6a57d0867778e98a7d69430e0d3d0 (diff) | |
download | evtclib-7bf28dc7b3df4d8663c97bedadbfb09f48e9db39.tar.gz evtclib-7bf28dc7b3df4d8663c97bedadbfb09f48e9db39.tar.bz2 evtclib-7bf28dc7b3df4d8663c97bedadbfb09f48e9db39.zip |
add StackActive and StackReset events
As it turns out, the padding bytes are not just padding, but for some
events they contain useful information. Therefore, we've adjusted the
parser to save those bytes (if available).
Diffstat (limited to 'src/event.rs')
-rw-r--r-- | src/event.rs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/event.rs b/src/event.rs index 8004002..7cc5010 100644 --- a/src/event.rs +++ b/src/event.rs @@ -135,6 +135,16 @@ pub enum EventKind { duration: i32, }, + /// Mark the given buff stack as active. + StackActive { agent_addr: u64, stack_id: u32 }, + + /// Reset the duration of the given stack. + StackReset { + agent_addr: u64, + stack_id: u32, + duration: i32, + }, + /// Position of the agent has changed. Position { agent_addr: u64, @@ -399,10 +409,17 @@ impl TryFrom<&raw::CbtEvent> for Event { // The README says "internal use, won't see anywhere", so if we find one, we treat it // as an error. CbtStateChange::ReplInfo => return Err(FromRawEventError::UnexpectedReplInfo), + CbtStateChange::StackActive => EventKind::StackActive { + agent_addr: raw_event.src_agent, + stack_id: raw_event.dst_agent as u32, + }, + CbtStateChange::StackReset => EventKind::StackReset { + agent_addr: raw_event.src_agent, + stack_id: raw_event.padding_end, + duration: raw_event.value, + }, // XXX: implement proper handling of those events! - CbtStateChange::StackActive - | CbtStateChange::StackReset - | CbtStateChange::BuffInfo + CbtStateChange::BuffInfo | CbtStateChange::BuffFormula | CbtStateChange::SkillInfo | CbtStateChange::SkillTiming |