![]() |
VOOZH | about |
dotnet add package Codemasters.F1_2020 --version 4.3.3
NuGet\Install-Package Codemasters.F1_2020 -Version 4.3.3
<PackageReference Include="Codemasters.F1_2020" Version="4.3.3" />
<PackageVersion Include="Codemasters.F1_2020" Version="4.3.3" />Directory.Packages.props
<PackageReference Include="Codemasters.F1_2020" />Project file
paket add Codemasters.F1_2020 --version 4.3.3
#r "nuget: Codemasters.F1_2020, 4.3.3"
#:package Codemasters.F1_2020@4.3.3
#addin nuget:?package=Codemasters.F1_2020&version=4.3.3Install as a Cake Addin
#tool nuget:?package=Codemasters.F1_2020&version=4.3.3Install as a Cake Tool
The F1 2020 video game will provide to you a UDP data package in the form of a byte array (byte[]). There are several different types of data packets that the game will broadcast. Import the following namespace to use the basic resources for reading data:
using Codemasters.F1_2020;
Every packet type derives from the same base class, Packet. The Packet class contains the following properties:
PacketFormat - Describes the game the packet is from (F1 2020)
GameMajorVersion - The major version of the game at the time of broadcast
GameMinorVersion - The minor version of the game at the time of broadcast
PacketVersion
PacketType - The type of packet this data is (i.e. Telemetry, status, lap data, etc.)
UniqueSessionId - The unique ID of your session.
SessioTime - The timestamp of the current session when this packet was recorded and broadcasted.
FrameIdentifier - Which grouping of packets this data belongs to.
PlayerCarIndex - The index of the player's car in field arrays in all corresponding packets.
SecondaryPlayerCarIndex - If you are playing two player (split screen), this will be player 2's index in the field array.
To tell what type of packet any array of bytes that was provided to you is, use the CodemastersToolkit. The bytes variable below would come from your telemetry broadcast, or from a deserialized file if you saved telemetry on disk.
byte[] bytes; //Your telemetry data package
PacketType pt = CodemastersToolkit.GetPacketType(bytes);
Console.WriteLine(pt.ToString());
Console output of the above: "CarTelemetry"
Since we know that this particular data package is a telemetry packet, we can create a telemetry package:
TelemetryPacket tp = new TelemetryPacket();
tp.LoadBytes(bytes);
The TelemetryPacket class contains an array of CarTelemetryData, one for each car in the field.
As an exmaple, the below code will print the throttle pressure that every driver is applying at the moment this data was broadcasted.
foreach (TelemetryPacket.CarTelemetryData ctd in tp.FieldTelemetryData)
{
Console.WriteLine(ctd.Throttle.ToString());
}
Many of the packets follow a similar format as is seen above with the TelemetryPacket.
You can convert all of the byte array packages that you received. Example:
List<byte[]> telemetry;
Packet[] packets = CodemastersToolkit.BulkConvertByteArraysToPackets(telemetry);
You can then convert each packet from the returned array of packets. For example, converting a Packet to the TelemetryPacket:
foreach (Packet p in packets)
{
if (p.PacketType == PacketType.CarTelemetry)
{
TelemetryPacket telpack = (TelemetryPacket)p;
}
}
You may need to, for example, find the accompanying CarStatusPacket for a particular TelemetryPacket. To do this:
TelemetryPacket telpack;
CarStatusPacket csp = (CarStatusPacket)telpack.GetRelatedPacket(packets, PacketType.CarStatus);
**If you previously used the Codemasters.F1_2020.Analysis namespace and now find it missing: The analysis namespace has been moved under the ApexVisual.F1_2020 NuGet package (https://www.nuget.org/packages/ApexVisual.F1_2020/)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 is compatible. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 2 NuGet packages that depend on Codemasters.F1_2020:
| Package | Downloads |
|---|---|
|
ApexVisual.F1_2020
Package Description |
|
|
ApexVisual
.NET class library supporting the Apex Visual application |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.3.3 | 4,167 | 8/14/2021 |
| 4.3.2 | 1,188 | 8/13/2021 |
| 4.3.1 | 779 | 8/13/2021 |
| 4.3.0 | 3,261 | 12/18/2020 |
| 4.2.0 | 891 | 12/16/2020 |
| 4.1.0 | 4,018 | 12/4/2020 |
| 4.0.0 | 1,531 | 11/29/2020 |
| 3.0.0 | 2,359 | 11/6/2020 |
| 2.0.3 | 969 | 10/29/2020 |
| 2.0.2 | 950 | 9/24/2020 |
| 2.0.1 | 1,130 | 9/19/2020 |
| 2.0.0 | 945 | 9/15/2020 |
| 1.4.0 | 977 | 9/15/2020 |
| 1.3.0 | 910 | 9/6/2020 |
| 1.2.3 | 987 | 8/17/2020 |
| 1.2.2 | 2,881 | 8/15/2020 |
| 1.2.1 | 1,223 | 8/12/2020 |
| 1.2.0 | 1,032 | 8/12/2020 |
| 1.1.0 | 1,238 | 8/3/2020 |
| 1.0.0 | 1,055 | 8/2/2020 |