F1Game.UDP 24.0.0

dotnet add package F1Game.UDP --version 24.0.0                
NuGet\Install-Package F1Game.UDP -Version 24.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="F1Game.UDP" Version="24.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add F1Game.UDP --version 24.0.0                
#r "nuget: F1Game.UDP, 24.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install F1Game.UDP as a Cake Addin
#addin nuget:?package=F1Game.UDP&version=24.0.0

// Install F1Game.UDP as a Cake Tool
#tool nuget:?package=F1Game.UDP&version=24.0.0                

F1Game.UDP

NuGet BuildStatus

Library to parse UDP telemetry packets from F1 24 game.

UDP Specification

UDP specification is here.

Versioning

Each major version of the F1Game.UDP library is designed to support a specific version of the F1 game. The major version number of the library corresponds to the version of the game it supports. For example, F1Game.UDP version 23.x supports F1 23 game, and version 24.x supports F1 24 game and so on.

Usages

You can parse an array of bytes to packets using the ToPacket extension method. The ToPacket method returns a UnionPacket struct, which has properties for different types of packets, such as:

  • CarDamageDataPacket
  • CarSetupDataPacket
  • CarStatusDataPacket
  • CarTelemetryDataPacket
  • EventDataPacket
  • FinalClassificationDataPacket
  • LapDataPacket
  • LobbyInfoDataPacket
  • MotionDataPacket
  • MotionExDataPacket
  • ParticipantsDataPacket
  • SessionDataPacket
  • SessionHistoryDataPacket
  • TimeTrialDataPacket
  • TyreSetsDataPacket

You can access the specific packet data by accessing the corresponding property of the UnionPacket struct, you should check what packet type it is first using PacketType property.

using F1Game.UDP;

UnionPacket packet = arrayOfBytes.ToPacket();

if (packet.PacketType == PacketType.CarTelemetry)
{
	CarTelemetryDataPacket carTelemetryData = packet.CarTelemetryData;
	// Access car telemetry data
}

switch (packet.PacketType)
{
	case PacketType.CarTelemetry:
		CarTelemetryDataPacket carTelemetryData = packet.CarTelemetryData;
		// Access car telemetry data
		break;
	case PacketType.CarStatus:
		CarStatusDataPacket carStatusData = packet.CarStatusData;
		// Access car status data
		break;
	// Add other cases for different packet types
}

Benchmarks

You can check performance of the library by running benchmarks in F1Game.UDP.Benchmarks project.

Results on my machine are here.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
24.0.0 130 6/13/2024
23.2.0 101 6/12/2024
23.1.0 109 6/10/2024
23.0.1 106 6/9/2024
23.0.0-alpha 94 6/8/2024
0.0.1-alpha 168 12/25/2023