-
Notifications
You must be signed in to change notification settings - Fork 34
/
StaticInfo.cs
93 lines (82 loc) · 2.88 KB
/
StaticInfo.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace AssettoCorsaSharedMemory
{
public class StaticInfoEventArgs : EventArgs
{
public StaticInfoEventArgs (StaticInfo staticInfo)
{
this.StaticInfo = staticInfo;
}
public StaticInfo StaticInfo { get; private set; }
}
[StructLayout (LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
[Serializable]
public struct StaticInfo
{
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 15)]
public String SMVersion;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 15)]
public String ACVersion;
// session static info
public int NumberOfSessions;
public int NumCars;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 33)]
public String CarModel;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 33)]
public String Track;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 33)]
public String PlayerName;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 33)]
public String PlayerSurname;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 33)]
public String PlayerNick;
public int SectorCount;
// car static info
public float MaxTorque;
public float MaxPower;
public int MaxRpm;
public float MaxFuel;
[MarshalAs (UnmanagedType.ByValArray, SizeConst = 4)]
public float[] SuspensionMaxTravel;
[MarshalAs (UnmanagedType.ByValArray, SizeConst = 4)]
public float[] TyreRadius;
// since 1.5
public float MaxTurboBoost;
public float Deprecated1; // AirTemp since 1.6 in physic
public float Deprecated2; // RoadTemp since 1.6 in physic
public int PenaltiesEnabled;
public float AidFuelRate;
public float AidTireRate;
public float AidMechanicalDamage;
public int AidAllowTyreBlankets;
public float AidStability;
public int AidAutoClutch;
public int AidAutoBlip;
// since 1.7.1
public int HasDRS;
public int HasERS;
public int HasKERS;
public float KersMaxJoules;
public int EngineBrakeSettingsCount;
public int ErsPowerControllerCount;
// since 1.7.2
public float TrackSPlineLength;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 15)]
public string TrackConfiguration;
// since 1.10.2
public float ErsMaxJ;
// since 1.13
public int IsTimedRace;
public int HasExtraLap;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = 33)]
public String CarSkin;
public int ReversedGridPositions;
public int PitWindowStart;
public int PitWindowEnd;
}
}