record-daemon: fix summoner spells handling
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m22s
All checks were successful
record-daemon / Build, check and test (push) Successful in 2m22s
This commit is contained in:
@@ -403,40 +403,56 @@ impl Daemon {
|
||||
});
|
||||
|
||||
// If we have puuid and session, extract player-specific data from session
|
||||
let (champion, final_team, final_summoner_name) = if let Some(ref p) = puuid
|
||||
{
|
||||
if let Some(ref sess) = session {
|
||||
let champ_id = sess.get_champion_id(p);
|
||||
let champ_name =
|
||||
champ_id.and_then(record_daemon::lqp::champion_id_to_name);
|
||||
let team_id = sess.get_team(p);
|
||||
let summoner = sess.get_summoner_name(p).map(|s| s.to_string());
|
||||
(
|
||||
champ_name.or_else(|| {
|
||||
let (champion, final_team, final_summoner_name, final_summoner_spells) =
|
||||
if let Some(ref p) = puuid {
|
||||
if let Some(ref sess) = session {
|
||||
let champ_id = sess.get_champion_id(p);
|
||||
let champ_name =
|
||||
champ_id.and_then(record_daemon::lqp::champion_id_to_name);
|
||||
let team_id = sess.get_team(p);
|
||||
let summoner = sess.get_summoner_name(p).map(|s| s.to_string());
|
||||
|
||||
// Extract summoner spells from session's player_champion_selections
|
||||
let spells_from_session =
|
||||
sess.get_player_selection(p).map(|selection| {
|
||||
record_daemon::lqp::SummonerSpells {
|
||||
spell1_id: selection.spell1_id,
|
||||
spell2_id: selection.spell2_id,
|
||||
spell1_name: None,
|
||||
spell2_name: None,
|
||||
}
|
||||
});
|
||||
|
||||
(
|
||||
champ_name.or_else(|| {
|
||||
champion_id
|
||||
.and_then(record_daemon::lqp::champion_id_to_name)
|
||||
}),
|
||||
team_id.or(team),
|
||||
summoner.or(summoner_name),
|
||||
spells_from_session.or(summoner_spells),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
champion_id
|
||||
.and_then(record_daemon::lqp::champion_id_to_name)
|
||||
}),
|
||||
team_id.or(team),
|
||||
summoner.or(summoner_name),
|
||||
)
|
||||
.and_then(record_daemon::lqp::champion_id_to_name),
|
||||
team,
|
||||
summoner_name,
|
||||
summoner_spells,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
(
|
||||
champion_id.and_then(record_daemon::lqp::champion_id_to_name),
|
||||
team,
|
||||
summoner_name,
|
||||
summoner_spells,
|
||||
)
|
||||
}
|
||||
} else {
|
||||
(
|
||||
champion_id.and_then(record_daemon::lqp::champion_id_to_name),
|
||||
team,
|
||||
summoner_name,
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
info!(
|
||||
"[EVENT_HANDLER] Final values: puuid={:?}, runes={:?}, summoner_spells={:?}",
|
||||
puuid, runes, summoner_spells
|
||||
puuid, runes, final_summoner_spells
|
||||
);
|
||||
|
||||
// Fetch all players identities for puuid mapping
|
||||
@@ -464,7 +480,7 @@ impl Daemon {
|
||||
summoner_name: final_summoner_name,
|
||||
puuid,
|
||||
runes,
|
||||
summoner_spells,
|
||||
summoner_spells: final_summoner_spells,
|
||||
all_players: all_players_info,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user