fix: add missing fields in session and event packets

This commit is contained in:
Maciej Pędzich 2025-02-17 21:40:10 +01:00
parent e4728bcf45
commit 70c51b5276
Signed by: maciejpedzich
GPG Key ID: CE4A303D84882F0D
2 changed files with 14 additions and 1 deletions

View File

@ -1,4 +1,4 @@
use super::u8_to_usize;
use super::{u8_to_bool, u8_to_usize};
use crate::constants::{ButtonStatus, InfringementType, PenaltyType};
use binrw::BinRead;
@ -83,6 +83,17 @@ pub enum EventDataDetails {
vehicle_index: usize,
/// Top speed achieved in kilometres per hour.
speed: f32,
/// Whether the driver is overall fastest in the session.
#[br(map(u8_to_bool))]
is_overall_fastest_in_session: bool,
/// Whether this speed is personal fastest in the session.
#[br(map(u8_to_bool))]
is_driver_fastest_in_session: bool,
/// Index of the vehicle that's the fastest in the session.
#[br(map(u8_to_usize))]
fastest_vehicle_index: usize,
/// Fastest speed in the session in kilometres per hour.
fastest_speed_in_session: f32,
},
/// Sent when a start light is lit.
#[br(magic = b"STLG")]

View File

@ -159,6 +159,8 @@ pub struct F1PacketSessionData {
pub game_mode: GameMode,
/// Ruleset's identifier.
pub ruleset: Ruleset,
/// Local time of day - minutes since midnight
pub time_of_day: u32,
/// Session's length.
pub session_length: SessionLength,
}