rF2SharedMemoryNet 1.0.4

dotnet add package rF2SharedMemoryNet --version 1.0.4
                    
NuGet\Install-Package rF2SharedMemoryNet -Version 1.0.4
                    
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="rF2SharedMemoryNet" Version="1.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="rF2SharedMemoryNet" Version="1.0.4" />
                    
Directory.Packages.props
<PackageReference Include="rF2SharedMemoryNet" />
                    
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 rF2SharedMemoryNet --version 1.0.4
                    
#r "nuget: rF2SharedMemoryNet, 1.0.4"
                    
#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 rF2SharedMemoryNet@1.0.4
                    
#: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=rF2SharedMemoryNet&version=1.0.4
                    
Install as a Cake Addin
#tool nuget:?package=rF2SharedMemoryNet&version=1.0.4
                    
Install as a Cake Tool

About rF2SharedMemoryNet

This project is meant to give you read access to all the data exposed by rFactor 2 shared memory files. It additionally adds some Le Mans Ultimate telemetry that's not available through shared memory. Le Mans Ultimate telemetry depends on accessing LMU process memory. There is potential that it will break in with next updates. It is not officially supported so if memory layout changes or they implement anti-cheat it might break.

Prerequisites

  • For this to work it depends on rFactor2 or Le Mans Ultimate to have rFactor2SharedMemoryMapPlugin64.dll enabled.
  • .net 8.0

Quick start

Instalation

NuGet

You can install this through NuGet this is the easiet way to access the functionality of this package.

nuget install rF2SharedMemoryNet

GitHub Release

You can download a dll from the releases of this repository.

Build

You can clone the github repo and build it yourself.

git clone https://github.com/Domaslau/rF2SharedMemoryNet.git

Simple Example

Here is a simple example of how to retrieve telemetry data of player vehicle.

using rF2SharedMemoryNet;
using rF2SharedMemoryNet.RF2Data.Enums;
using rF2SharedMemoryNet.RF2Data.Structs;

namespace MyApplication{

    [SupportedOSPlatform("windows")]
    public class MyMemoryReader
    {
        private readonly RF2MemoryReader MemoryReader;

        public MyMemoryReader()
        {
            MemoryReader = new();
        }

        public async Task<VehicleTelemetry?> ReadAsyncTelemetry()
        {
            var telemetry = await MemoryReader.GetTelemetryAsync();
            var scoring = await MemoryReader.GetScoringAsync();

            if ((telemetry == null) || (scoring == null))
            {
                return null;
            }

            var playerVehicle = scoring.Value.Vehicles.First(vehicle => (ControlEntity)vehicle.Control == ControlEntity.Player);
            var playerTelemetry = telemetry.Value.Vehicles.First(vehicle => vehicle.ID == playerVehicle.ID);


            return playerTelemetry;
        }

        public void Close()
        {
            MemoryReader.Dispose();
        }
    }
}

LMU Electronics Example

Here is an example with LMU electronics data.

using rF2SharedMemoryNet;
using rF2SharedMemoryNet.RF2Data.Enums;
using rF2SharedMemoryNet.LMUData.Models;

namespace MyApplication{

    [SupportedOSPlatform("windows")]
    public class MyMemoryReader
    {
        private readonly RF2MemoryReader MemoryReader;

        public MyMemoryReader()
        {
            MemoryReader = new(enableDMA:true); // Need to set this to true to initialize LMU memory reader.
        }

        public Electronics ReadElectronics()
        {
            return MemoryReader.GetLMUElectronics();
        }

        public void Close()
        {
            MemoryReader.Dispose();
        }
    }
}

Other Info

For all of the methods reffer to API page.

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 was computed.  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.

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
1.0.4 495 7/22/2025
1.0.3 35 7/18/2025
1.0.2 122 7/17/2025