InSimDotNet.NET
6.5.4.1
dotnet add package InSimDotNet.NET --version 6.5.4.1
NuGet\Install-Package InSimDotNet.NET -Version 6.5.4.1
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="InSimDotNet.NET" Version="6.5.4.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="InSimDotNet.NET" Version="6.5.4.1" />
<PackageReference Include="InSimDotNet.NET" />
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 InSimDotNet.NET --version 6.5.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: InSimDotNet.NET, 6.5.4.1"
#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 InSimDotNet.NET@6.5.4.1
#: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=InSimDotNet.NET&version=6.5.4.1
#tool nuget:?package=InSimDotNet.NET&version=6.5.4.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
InSim.NET for .NET 6 / .NET 8
This is a fork of InSim.NET ported to .NET 6 / .NET 8.
- master branch — .NET Framework 4.8 (classic)
- net6 branch — .NET 6 / .NET 8 (this branch)
The original documentation still applies for core InSim usage.
Installation
Reference the NuGet package in your project.
If you get runtime errors about missing assemblies, add these to your .csproj:
<PackageReference Include="System.IO.FileSystem" Version="4.3.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.1" />
Quick Start
InSim insim = new InSim();
insim.Bind<IS_MSO>(MessageOut);
insim.Initialize(new InSimSettings {
Host = "127.0.0.1",
Port = 29999,
Admin = string.Empty,
});
while (insim.IsConnected)
Thread.Sleep(200);
void MessageOut(InSim insim, IS_MSO packet) {
Console.WriteLine(packet.Msg);
}
Car Setup Validation — CarSetupHelper
This fork adds CarSetupHelper in the InSimDotNet.Helpers namespace for comparing car setups received via IS_SET against a reference .set file.
Basic usage
// Load the reference .set file bytes
byte[] referenceSetBytes = File.ReadAllBytes("reference.set");
// Bind the IS_SET packet event
insim.Bind<IS_SET>(OnCarSetup);
void OnCarSetup(InSim insim, IS_SET packet) {
var diffs = CarSetupHelper.CompareSetups(referenceSetBytes, packet);
if (diffs.Count == 0) {
Console.WriteLine("Setup matches the reference.");
} else {
foreach (var d in diffs)
Console.WriteLine($"{d.Field}: expected {d.ExpectedValue}, got {d.ActualValue}");
}
}
SetupDifference
Each entry in the returned list has:
| Property | Type | Description |
|---|---|---|
Field |
SetupField |
Enum value identifying the differing field |
ExpectedValue |
string |
Human-readable value from the reference setup |
ActualValue |
string |
Human-readable value from the driver's setup |
SetupField enum
All comparable fields:
ExtraWeight, IntakeRestriction, ExtraWeightDistribution
RearWing, FrontWing
BrakePower, BrakeDistribution, Handbrake, AntiLockBrakesActive
MaxSteeringAngle, SteeringParallel, FrontToe, RearToe, Caster
FinalDriveRatio, Gear1–Gear7
FrontDifferentialType, FrontDifferentialPreload, FrontDifferentialPowerLock,
FrontDifferentialCoastLock, FrontDifferentialViscosity
RearDifferentialType, RearDifferentialPreload, RearDifferentialPowerLock,
RearDifferentialCoastLock, RearDifferentialViscosity
CenterDifferentialType, CenterDifferentialViscosity, CenterDifferentialPowerSplit
TractionControlActive, TractionControlSlipAllowed, TractionControlMinSpeed
FrontSuspensionHeight, FrontSuspensionStiffness, FrontSuspensionBumpDamper,
FrontSuspensionReboundDamper, FrontSuspensionAntiRollBar
RearSuspensionHeight, RearSuspensionStiffness, RearSuspensionBumpDamper,
RearSuspensionReboundDamper, RearSuspensionAntiRollBar
WheelManufacturer
FrontTyreCompound, RearTyreCompound, FrontTyreSize, RearTyreSize
FrontLeftTyrePressure, FrontRightTyrePressure, RearLeftTyrePressure, RearRightTyrePressure
FrontLeftCamber, FrontRightCamber, RearLeftCamber, RearRightCamber
Passenger, CarConfig
Parsing a setup file directly
byte[] bytes = File.ReadAllBytes("mysetup.set");
CarSetupHelper.ParsedCarSetup parsed = CarSetupHelper.ParseSetup(bytes, isFile: true);
Console.WriteLine($"Rear wing: {parsed.RearWing}");
Console.WriteLine($"TC min speed: {parsed.TractionControlMinSpeed} m/s");
Comparing two parsed setups
var expected = CarSetupHelper.ParseSetup(refBytes, isFile: true);
var actual = CarSetupHelper.ParseSetup(actualBytes, isFile: true);
var diffs = CarSetupHelper.CompareSetups(expected, actual);
| Product | Versions 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.
-
net8.0
- System.IO.FileSystem (>= 4.3.0)
- System.Text.Encoding.CodePages (>= 4.5.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.