Table of Contents

Struct Rules

Namespace
rF2SharedMemoryNet.RF2Data.Structs
Assembly
rF2SharedMemoryNet.dll

Represents the rules and state information for the rFactor 2 simulation, including track rules, actions, and participants.

public struct Rules
Inherited Members

Remarks

This structure is used to manage and synchronize simulation data related to track rules, vehicle actions, and participants. It includes versioning fields to track updates and hints about the number of bytes updated during the last synchronization.

Fields

Actions

Represents an array of track rule actions mapped to vehicles.

public TrackRulesAction[] Actions

Field Value

TrackRulesAction[]

Remarks

The array is fixed in size, with a maximum length defined by MAX_MAPPED_VEHICLES. Each element corresponds to a specific track rule action for a mapped vehicle.

BytesUpdatedHint

Represents the number of bytes written to the structure during the last update.

public int BytesUpdatedHint

Field Value

int

Remarks

This value serves as a hint for the number of bytes updated in the structure. It may be useful for tracking or debugging purposes.

Participants

Represents an array of participants in the track rules system.

public TrackRulesParticipant[] Participants

Field Value

TrackRulesParticipant[]

Remarks

The array is marshaled using the ByValArray attribute, ensuring compatibility with unmanaged code. The size of the array is determined by the constant MAX_MAPPED_VEHICLES.

TrackRules

Represents the track rules for an RF2 simulation.

public TrackRules TrackRules

Field Value

TrackRules

VersionUpdateBegin

Represents the version number of the buffer at the point when an update begins.

public uint VersionUpdateBegin

Field Value

uint

Remarks

This value is incremented immediately before the buffer is written to, indicating the start of an update process. It can be used to track changes or ensure consistency during buffer operations.

VersionUpdateEnd

Represents the version update counter, which is incremented after a buffer write operation is completed.

public uint VersionUpdateEnd

Field Value

uint

Remarks

This field is used to track the completion of buffer write operations. It is incremented automatically after each write to indicate the end of the update process.