record-daemon: add record raw events, subscribe lp change events
record-daemon / Build, check and test (push) Successful in 2m0s
record-daemon / Build, check and test (push) Successful in 2m0s
This commit is contained in:
@@ -223,11 +223,12 @@ impl Daemon {
|
||||
}
|
||||
|
||||
/// Handle a game event.
|
||||
async fn handle_game_event(&self, event: GameEvent) -> Result<()> {
|
||||
async fn handle_game_event(&self, parsed: record_daemon::lqp::ParsedEvent) -> Result<()> {
|
||||
let event = &parsed.event;
|
||||
info!("[EVENT_HANDLER] Game event received: {:?}", event);
|
||||
|
||||
// Handle pre-game data collection
|
||||
match &event {
|
||||
match event {
|
||||
GameEvent::PhaseChange(info) if info.phase == "ChampSelect" => {
|
||||
info!("[EVENT_HANDLER] Champion select started");
|
||||
}
|
||||
@@ -249,10 +250,10 @@ impl Daemon {
|
||||
// Record event to timeline if recording (BEFORE state transition for GameEnd)
|
||||
// This ensures GameEnd events are recorded while still in recording state
|
||||
if self.state_machine.is_recording() {
|
||||
if let Some((video_ts, game_ts)) = self.event_mapper.write().handle_event(&event) {
|
||||
if let Some((video_ts, game_ts)) = self.event_mapper.write().handle_event(event) {
|
||||
// Get the current recording ID
|
||||
if let Some(recording_id) = *self.current_recording_id.read() {
|
||||
// Create a timestamped event
|
||||
// Create a timestamped event with raw data
|
||||
let timestamped_event = TimestampedEvent {
|
||||
video_timestamp: video_ts,
|
||||
game_timestamp: game_ts,
|
||||
@@ -260,6 +261,8 @@ impl Daemon {
|
||||
event_type: event.event_type_name().to_string(),
|
||||
description: event.description(),
|
||||
event: event.clone(),
|
||||
raw_data: Some(parsed.raw_data.clone()),
|
||||
uri: Some(parsed.uri.clone()),
|
||||
};
|
||||
|
||||
// Add the event to the timeline store
|
||||
@@ -284,7 +287,7 @@ impl Daemon {
|
||||
}
|
||||
|
||||
// Process state transitions
|
||||
if let Some(transition) = self.state_machine.process_event(&event) {
|
||||
if let Some(transition) = self.state_machine.process_event(event) {
|
||||
info!("[EVENT_HANDLER] State transition: {:?}", transition);
|
||||
|
||||
// Only process the transition if it's valid
|
||||
|
||||
Reference in New Issue
Block a user