Skip to content
This repository was archived by the owner on Sep 21, 2024. It is now read-only.
This repository was archived by the owner on Sep 21, 2024. It is now read-only.

3 - Event #4

@janesth

Description

@janesth

Structure:

// The event details packet is different for each type of event.
// Make sure only the correct type is interpreted.

struct PacketEventData
{
    PacketHeader    	m_header;               	// Header
    
    uint8           	m_eventStringCode[4];   	// Event string code, see below
    EventDataDetails	m_eventDetails;         	// Event details - should be interpreted differently
                                                 // for each type
};

union EventDataDetails
{
    struct
    {
        uint8	vehicleIdx; // Vehicle index of car achieving fastest lap
        float	lapTime;    // Lap time is in seconds
    } FastestLap;

    struct
    {
        uint8   vehicleIdx; // Vehicle index of car retiring
    } Retirement;

    struct
    {
        uint8   vehicleIdx; // Vehicle index of team mate
    } TeamMateInPits;

    struct
    {
        uint8   vehicleIdx; // Vehicle index of the race winner
    } RaceWinner;

    struct
    {
    	uint8 penaltyType;		// Penalty type – see Appendices
        uint8 infringementType;		// Infringement type – see Appendices
        uint8 vehicleIdx;         	// Vehicle index of the car the penalty is applied to
        uint8 otherVehicleIdx;    	// Vehicle index of the other car involved
        uint8 time;               	// Time gained, or time spent doing action in seconds
        uint8 lapNum;             	// Lap the penalty occurred on
        uint8 placesGained;       	// Number of places gained by this
    } Penalty;

    struct
    {
        uint8 vehicleIdx;		// Vehicle index of the vehicle triggering speed trap
        float speed;      		// Top speed achieved in kilometres per hour
        uint8 overallFastestInSession;   // Overall fastest speed in session = 1, otherwise 0
        uint8 driverFastestInSession;    // Fastest speed for driver in session = 1, otherwise 0
    } SpeedTrap;

    struct
    {
        uint8 numLights;		// Number of lights showing
    } StartLIghts;

    struct
    {
        uint8 vehicleIdx;                 // Vehicle index of the vehicle serving drive through
    } DriveThroughPenaltyServed;

    struct
    {
        uint8 vehicleIdx;                 // Vehicle index of the vehicle serving stop go
    } StopGoPenaltyServed;

    struct
    {
        uint32 flashbackFrameIdentifier;  // Frame identifier flashed back to
        float flashbackSessionTime;       // Session time flashed back to
    } Flashback;

    struct
    {
        uint32         m_buttonStatus;    // Bit flags specifying which buttons are being pressed
                                          // currently - see appendices
    } Buttons;
};

Event Codes:

Event Code Description
Session Started "SSTA" Sent when the session starts
Session Ended "SEND" Sent when the session ends
Fastest Lap "FTLP" When a driver achieves the fastest lap
Retirement "RTMT" When a driver retires
DRS enabled "DRSE" Race control have enabled DRS
DRS disabled "DRSD" Race control have disabled DRS
Team mate in pits "TMPT" Your team mate has entered the pits
Chequered flag "CHQF" The chequered flag has been waved
Race Winner "RCWN" The race winner is announced
Penalty Issued "PENA" A penalty has been issued - details in event
Speed Trap Triggered "SPTP" Speed trap has been triggered by fastest lap
Start lights "STLG" Start lights - number shown
Lights out "LGOUT" Lights out
Drive through served "DTSV" Drive through penalty served
Stop go served "SGSV" Stop go penalty served
Flashback "FLBK" Flashback activated
Button status "BUTN" Button status changed

Penalty Types:

ID Penalty Meaning
0 Drive through
1 Stop Go
2 Grid penalty
3 Penalty reminder
4 Time penalty
5 Warning
6 Disqualified
7 Removed from formation lap
8 Parked too long timer
9 Tyre regulations
10 This lap invalidated
11 This and next lap invalidated
12 This lap invalidated without reason
13 This and next lap invalidated without reason
14 This and previous lap invalidated
15 This and previous lap invalidated without reason
16 Retired
17 Black flag timer

Infringement Types:

ID Infringement Meaning
0 Blocking by slow driving
1 Blocking by wrong way driving
2 Reversing off the start line
3 Big Collision
4 Small Collision
5 Collision failed to hand back position single
6 Collision failed to hand back position multiple
7 Corner cutting gained time
8 Corner cutting overtake single
9 Corner cutting overtake multiple
10 Crossed pit exit lane
11 Ignoring blue flags
12 Ignoring yellow flags
13 Ignoring drive through
14 Too many drive throughs
15 Drive through reminder serve within n laps
16 Drive through reminder serve this lap
17 Pit lane speeding
18 Parked for too long
19 Ignoring tyre regulations
20 Too many penalties
21 Multiple warnings
22 Approaching disqualification
23 Tyre regulations select single
24 Tyre regulations select multiple
25 Lap invalidated corner cutting
26 Lap invalidated running wide
27 Corner cutting ran wide gained time minor
28 Corner cutting ran wide gained time significant
29 Corner cutting ran wide gained time extreme
30 Lap invalidated wall riding
31 Lap invalidated flashback used
32 Lap invalidated reset to track
33 Blocking the pitlane
34 Jump start
35 Safety car to car collision
36 Safety car illegal overtake
37 Safety car exceeding allowed pace
38 Virtual safety car exceeding allowed pace
39 Formation lap below allowed speed
40 Retired mechanical failure
41 Retired terminally damaged
42 Safety car falling too far back
43 Black flag timer
44 Unserved stop go penalty
45 Unserved drive through penalty
46 Engine component change
47 Gearbox change
48 League grid penalty
49 Retry penalty
50 Illegal time gain
51 Mandatory pitstop

Models:
PLEASE INCLUDE THE MODELS WHICH YOU ARE GOING TO ADD

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions