mirror of
https://github.com/maciejpedzich/f1-game-packet-parser.git
synced 2025-04-17 18:31:11 +02:00
fix: add missing fields in session and event packets
This commit is contained in:
parent
e4728bcf45
commit
70c51b5276
@ -1,4 +1,4 @@
|
|||||||
use super::u8_to_usize;
|
use super::{u8_to_bool, u8_to_usize};
|
||||||
use crate::constants::{ButtonStatus, InfringementType, PenaltyType};
|
use crate::constants::{ButtonStatus, InfringementType, PenaltyType};
|
||||||
|
|
||||||
use binrw::BinRead;
|
use binrw::BinRead;
|
||||||
@ -83,6 +83,17 @@ pub enum EventDataDetails {
|
|||||||
vehicle_index: usize,
|
vehicle_index: usize,
|
||||||
/// Top speed achieved in kilometres per hour.
|
/// Top speed achieved in kilometres per hour.
|
||||||
speed: f32,
|
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.
|
/// Sent when a start light is lit.
|
||||||
#[br(magic = b"STLG")]
|
#[br(magic = b"STLG")]
|
||||||
|
@ -159,6 +159,8 @@ pub struct F1PacketSessionData {
|
|||||||
pub game_mode: GameMode,
|
pub game_mode: GameMode,
|
||||||
/// Ruleset's identifier.
|
/// Ruleset's identifier.
|
||||||
pub ruleset: Ruleset,
|
pub ruleset: Ruleset,
|
||||||
|
/// Local time of day - minutes since midnight
|
||||||
|
pub time_of_day: u32,
|
||||||
/// Session's length.
|
/// Session's length.
|
||||||
pub session_length: SessionLength,
|
pub session_length: SessionLength,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user