F1Game.UDP 25.0.0

dotnet add package F1Game.UDP --version 25.0.0
                    
NuGet\Install-Package F1Game.UDP -Version 25.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="25.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="F1Game.UDP" Version="25.0.0" />
                    
Directory.Packages.props
<PackageReference Include="F1Game.UDP" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add F1Game.UDP --version 25.0.0
                    
#r "nuget: F1Game.UDP, 25.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.
#:package F1Game.UDP@25.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=F1Game.UDP&version=25.0.0
                    
Install as a Cake Addin
#tool nuget:?package=F1Game.UDP&version=25.0.0
                    
Install as a Cake Tool

F1Game.UDP

NuGet BuildStatus

Library to parse UDP telemetry packets from F1 25 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
  • LapPositionsDataPacket
  • LobbyInfoDataPacket
  • MotionDataPacket
  • MotionExDataPacket
  • ParticipantsDataPacket
  • SessionDataPacket
  • SessionHistoryDataPacket
  • TimeTrialDataPacket
  • TyreSetsDataPacket

First, check the packet type using the PacketType property. Then, access the specific packet data by calling the corresponding TryGet<PacketName> method of the UnionPacket struct.

using F1Game.UDP;

UnionPacket packet = arrayOfBytes.ToPacket();

if (packet.TryGetCarTelemetryDataPacket(out var carTelemetryData))
{
	// Access car telemetry data
}

switch (packet.PacketType)
{
	case PacketType.CarTelemetry when packet.TryGetCarTelemetryDataPacket(out var carTelemetryData):
		// Access car telemetry data
		break;
	case PacketType.CarStatus when packet.TryGetCarStatusDataPacket(out var carStatusData):
		// Access car status data
		break;
	// Add other cases for different packet types
}

var someResult = packet.PacketType switch
{
	PacketType.CarTelemetry when packet.TryGetCarTelemetryDataPacket(out var carTelemetryData) => // Access car telemetry data,
	PacketType.CarStatus when packet.TryGetCarStatusDataPacket(out var carStatusData) => // Access car status data,
	_ => "default"
};

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.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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.
  • net9.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
25.0.0 153 6/1/2025
24.1.0 140 6/1/2025
24.0.0 175 6/13/2024
23.2.0 125 6/12/2024
23.1.0 134 6/10/2024
23.0.1 130 6/9/2024
23.0.0-alpha 111 6/8/2024
0.0.1-alpha 181 12/25/2023