record-daemon: refactor to record raw league data
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
use tracing::{debug, info, warn};
|
||||
|
||||
use super::events::{GameEvent, GameflowSession};
|
||||
use super::mappings::map_id_to_name;
|
||||
|
||||
/// Parse a WebSocket message into a game event.
|
||||
pub fn parse_websocket_message(text: &str) -> Option<GameEvent> {
|
||||
@@ -233,22 +232,9 @@ fn parse_game_start_event(data: &serde_json::Value) -> Option<GameEvent> {
|
||||
.map(|s| s.to_string())
|
||||
});
|
||||
|
||||
// Extract map name
|
||||
let map_name = session
|
||||
.as_ref()
|
||||
.and_then(|s| s.map_id())
|
||||
.and_then(|id| map_id_to_name(id as u64))
|
||||
.or_else(|| {
|
||||
data.get("gameData")
|
||||
.and_then(|gd| gd.get("queue"))
|
||||
.and_then(|q| q.get("mapId"))
|
||||
.and_then(|id| id.as_u64())
|
||||
.and_then(map_id_to_name)
|
||||
});
|
||||
|
||||
info!(
|
||||
"Extracted game metadata: game_id={}, queue={:?}, queue_id={:?}, mode={:?}, map={:?}",
|
||||
game_id, queue_type, queue_id, game_mode, map_name
|
||||
"Extracted game metadata: game_id={}, queue={:?}, queue_id={:?}, mode={:?}",
|
||||
game_id, queue_type, queue_id, game_mode
|
||||
);
|
||||
|
||||
// Note: Player-specific data (champion, team, summoner_name) is NOT extracted here.
|
||||
@@ -263,7 +249,6 @@ fn parse_game_start_event(data: &serde_json::Value) -> Option<GameEvent> {
|
||||
"queueType": queue_type,
|
||||
"queueId": queue_id,
|
||||
"gameMode": game_mode,
|
||||
"map": map_name,
|
||||
"session": session
|
||||
}))
|
||||
.unwrap_or(GameEvent::Unknown),
|
||||
|
||||
Reference in New Issue
Block a user