diff --git a/RobertsmaniaPitGirl.sln b/RobertsmaniaPitGirl.sln new file mode 100644 index 0000000..c27f499 --- /dev/null +++ b/RobertsmaniaPitGirl.sln @@ -0,0 +1,37 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34018.315 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RobertsmaniaReplay", "RobertsmaniaReplay\RobertsmaniaReplay.csproj", "{C661FC90-C439-46CB-8876-3FFB0B1D0E3A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSdkWrapper", "iRacingSdkWrapper\iRacingSdkWrapper\iRacingSdkWrapper.csproj", "{D6DB568B-35B3-49EB-8CB3-E4E5F1424247}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRSDKSharp", "iRacingSdkWrapper\irsdkSharp\iRSDKSharp.csproj", "{72631B85-EB9A-473E-9B4C-65B355A9000D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C661FC90-C439-46CB-8876-3FFB0B1D0E3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C661FC90-C439-46CB-8876-3FFB0B1D0E3A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C661FC90-C439-46CB-8876-3FFB0B1D0E3A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C661FC90-C439-46CB-8876-3FFB0B1D0E3A}.Release|Any CPU.Build.0 = Release|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Release|Any CPU.Build.0 = Release|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AC00DC35-09B8-4BA4-BBF3-763F39B3E2EA} + EndGlobalSection +EndGlobal diff --git a/RobertsmaniaReplay/Properties/AssemblyInfo.cs b/RobertsmaniaReplay/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..9885f82 --- /dev/null +++ b/RobertsmaniaReplay/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VATestPlugin")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VATestPlugin")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c8fd4254-b088-4edc-b311-7354cad32629")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/RobertsmaniaReplay/RobertsmaniaPitGirlReplay-Profile.vap b/RobertsmaniaReplay/RobertsmaniaPitGirlReplay-Profile.vap new file mode 100644 index 0000000..e86ffd9 --- /dev/null +++ b/RobertsmaniaReplay/RobertsmaniaPitGirlReplay-Profile.vap @@ -0,0 +1,22568 @@ + + + false + 36a5f19b-d780-4cf6-83e8-95c73f3e83ce + RobertsmaniaPitGirlReplay + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 88d0fbc6-b89f-40f9-a084-8f4e7130bc6c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + c668ad58-8eae-4971-b6b9-717d6ccfc958 + [change; set;] [camera;] [to;] [rollbar; roll bar] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + d325f1df-6877-404f-91b2-e9686b0e2ec2 + TextSet + 0 + 0 + + ~~NewCamera + Roll Bar + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8bb9fe9f-649f-4523-965c-3d98d6a8e98f + TextSet + 0 + 0 + + ~~SaySomething + Roll bar camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 36fa6930-9a55-4463-81fb-6e0f3a414135 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2d6f988d-b80f-4624-8b7b-972302a366be + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + ad82699e-efa4-4da0-b1e8-26b0a0f84bbd + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + c869d7c8-73c6-4f54-9c9f-b7929ed9999c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 4017d989-a202-4a1f-8e41-d9386d5940c1 + [change; set;] [camera;] [to;] [the;] chopper [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 360aa478-d42c-4e04-b472-36507d2177ee + TextSet + 0 + 0 + + ~~NewCamera + Chopper + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 23896951-20c7-47f3-9201-cfcd5efe8b96 + TextSet + 0 + 0 + + ~~SaySomething + Chopper camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + f3499379-bb1e-4055-aef2-b42a77cf9415 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2bdd6911-9def-4b08-b572-43429fa82c1b + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 634182c8-e6f7-45c2-affc-4a572010a645 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 7fdb3eae-c9ba-43d6-b15c-6187c5c2a354 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + fea53ba1-49ea-4e7b-b423-4ef414037fb9 + [change; set;] [camera;] [to;] [tv 1; tv1] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 165c1afa-9ac4-4c39-aac7-2df6677c94f9 + TextSet + 0 + 0 + + ~~NewCamera + TV1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1b03c4c8-5a0f-4ba6-95da-a98962a78dac + TextSet + 0 + 0 + + ~~SaySomething + TV 1 camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + be685a8b-6f78-461f-a15d-aa949b04ca40 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 44221f2c-a178-4921-95ee-0983fafdeeb9 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 775383f4-02a9-4c1d-80c7-81f51f7241e8 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 2ac12944-3ab1-4474-ac77-c9462f16fdd5 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + e76066d6-84eb-4297-8bc6-72ff4f3cb560 + [change; set;] [camera;] [to;] [tv 2; tv2] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 5e1c8039-8766-485d-b401-1a92be78ec11 + TextSet + 0 + 0 + + ~~NewCamera + TV2 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1664cdab-872a-47a9-9d33-26a58002529b + TextSet + 0 + 0 + + ~~SaySomething + TV 2 camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + cfaa203d-675b-4ad2-a32c-cb285e9d8292 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 7bb9213f-a626-4cf7-8827-227b53d33a75 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 458e4958-7eb7-48b3-96bf-e4b7b1978014 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 074479cb-344c-40e8-b226-8b10abccdcee + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 42065125-5ee8-47a3-924f-2affc55526bf + [change; set;] [camera;] [to;] [tv 3; tv3] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + e674b88c-ce5c-4da2-a4e5-5c53d600b67f + TextSet + 0 + 0 + + ~~NewCamera + TV3 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5a53b0a4-2d97-4bbc-b8de-7576c015bd16 + TextSet + 0 + 0 + + ~~SaySomething + TV 3 camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5330da81-8a5b-41a4-b2d4-68ee097bf52f + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9bb1c7b6-d073-4596-b0a9-0673e3140ab0 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + ea84793a-0436-4858-b0a1-3f1da0e48439 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 767013de-3fff-4f0d-8dde-d953fd7ba150 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + d49c4488-9ef7-4857-bf56-2bf24a33d4b7 + [change; set;] [camera;] [to;] blimp [camera;] + + + false + false + 0 + + 0 + false + false + 0 + b7736b14-ef5d-4400-b69c-03d67637820d + TextSet + 0 + 0 + + ~~NewCamera + Blimp + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + aca39974-67fe-4592-95d9-b569a49e4fa0 + TextSet + 0 + 0 + + ~~SaySomething + Blimp camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + cb2c2297-6161-4ed8-a264-787d18745c3c + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9e1a6810-c488-4ae3-a3af-d6bb849d0436 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 49253141-32ae-4d22-ba88-ff0750f654cb + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + aa8e278c-03c6-4342-bcda-64fae548767a + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 733f24e2-3f22-46d5-885f-3e65e49d9311 + [change; set;] [camera;] [to;] chase [camera;] + + + false + false + 0 + + 0 + false + false + 0 + d813f33a-d3ff-4b49-be7f-0ac11c28e6d8 + TextSet + 0 + 0 + + ~~NewCamera + Chase + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6119138e-5b9c-48a1-a2e6-f31052c8a283 + TextSet + 0 + 0 + + ~~SaySomething + Chase camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9dc67d67-45f0-40b5-96f7-36cf177f196c + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2fd60636-b990-4bc5-97d2-5ccaf43cf080 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 2189d5f9-8be7-4295-bd66-40ce23be06c4 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + c1b9ee7e-fc11-42fd-aced-6f9cc4b6e2b5 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 0d39e1d3-a711-4998-9851-24ed7f413ca3 + [change; set;] [camera;] [to;] cockpit [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 827d561d-8412-424f-9efd-d6f4d45c30ba + TextSet + 0 + 0 + + ~~NewCamera + Cockpit + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 64c4b6d6-631a-4b96-b525-802454164802 + TextSet + 0 + 0 + + ~~SaySomething + Cockpit camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + dc204915-10ba-4234-81cf-19a5d464141c + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d7bec898-4d85-44b8-bf4b-4acfa04d4fd5 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 2febee02-ba01-4ec4-8e03-ae44fea19abc + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 29d9abf4-38a9-4f4f-9cdd-957a49fcf6e0 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + dcb99240-1471-45f4-87bf-89e40c4f8314 + [change; set;] [camera;] [to;] far chase [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 7bf7b620-e616-4408-b2fa-211b23b43f19 + TextSet + 0 + 0 + + ~~NewCamera + Far Chase + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 90ad32e4-9d6d-4924-80ac-0c11733f5ed7 + TextSet + 0 + 0 + + ~~SaySomething + Far chase camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d2449114-fd2c-4fd2-8329-3ab64662d199 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1dc3d5e8-44d1-4913-a130-35a8ab0975dd + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 49253141-32ae-4d22-ba88-ff0750f654cb + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 62bdb383-1758-4144-8e5f-2bbe4c1905a9 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 7d209a93-9ed2-4ad4-9abf-0b9f4d0d6de3 + [change; set;] [camera;] [to;] gearbox [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 50ce862c-e4f1-499e-8354-fb450cb80de0 + TextSet + 0 + 0 + + ~~NewCamera + Gearbox + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6c397fd4-d3bb-4066-bad5-bbb30a0231ee + TextSet + 0 + 0 + + ~~SaySomething + Gearbox camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 19e0a11f-654b-4998-8d18-9a5180aa4a41 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + f3288c1c-df01-44fc-9cd6-72f0521f4d60 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 6921c673-231b-46db-bf14-1d3b4ab4c216 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + e560621c-417a-4d9f-8557-6b33a07045f1 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 13657a0b-e6d2-4033-a25a-2ad8b24654d8 + [change; set;] [camera;] [to;] gyro [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 051c2ea8-18d6-47ad-bebd-8a43304283b9 + TextSet + 0 + 0 + + ~~NewCamera + Gyro + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + ed74f0d6-c4f5-4aae-90db-934b64b9bf88 + TextSet + 0 + 0 + + ~~SaySomething + Gyro camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 7d38e7c8-1745-4c10-9dce-2f327ffe3707 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 492c140f-75a0-45db-983f-38701e47c03a + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + cb6cecf7-7e92-436e-a503-23ed6c3aa8bf + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + de687310-18e6-4628-b2e4-3d9105d7e318 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 6d97d911-b310-4a48-acf7-a1386ad60c98 + [change; set;] [camera;] [to;] left front [suspension;] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + b58fee81-92da-4114-8261-5d31f205ba82 + TextSet + 0 + 0 + + ~~NewCamera + LF Susp + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6d8de152-7aaa-4313-be39-95ca7888d63e + TextSet + 0 + 0 + + ~~SaySomething + Left front suspension camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 3204fe77-2989-4ca2-91f6-22c1ded2ef51 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5441be36-8b9c-4d53-9724-785a5abf3368 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 70a5898d-9e19-4f71-b80e-5056ebf5ad4d + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + bacf40b7-5818-4264-9eb1-9e6ea6b8d4b5 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + d24be0a5-3de1-4b05-85e6-d8eb291ffa05 + [change; set;] [camera;] [to;] left rear [suspension;] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 2fe452d7-23a0-4267-8b77-65ae1410e550 + TextSet + 0 + 0 + + ~~NewCamera + LR Susp + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b02aebc6-8d6e-4822-9ab1-cb6362b585de + TextSet + 0 + 0 + + ~~SaySomething + Left rear suspension camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2bd0e1cf-c036-45dc-99b8-1809d95c3e3a + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5e3450ea-7518-440b-b659-5137a98a56a2 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 7c6dbcf6-4bc6-4924-9563-39daabab0d7e + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 082aafe1-cd28-4b0a-8549-a756d90ed531 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + e4a719b2-2ddf-4c91-ba11-69bc310410cd + [change; set;] [camera;] [to;] nose [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 974b334d-136d-49ee-a38e-79299b5d3f55 + TextSet + 0 + 0 + + ~~NewCamera + Nose + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + e113cbd6-6171-40fe-b9ff-7b175e711bbc + TextSet + 0 + 0 + + ~~SaySomething + Nose camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 174b02c3-666f-486a-804e-fced64b6d52b + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2cf284f6-d0f4-4c69-8fd4-6ba083c655dc + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 4ead28ec-b15b-44a6-9348-4554f628e77d + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 7ea74777-2749-4c58-a6b9-a694f3c847b0 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 748a06b3-bbb1-492f-bbf6-2ce6d45a5624 + [change; set;] [camera;] [to;] pit lane [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 60e07f41-b34c-4e4a-9b8e-fe100310ee07 + TextSet + 0 + 0 + + ~~NewCamera + Pit Lane + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 39bdea42-8c76-48d9-b1cf-6dcdd6b9f111 + TextSet + 0 + 0 + + ~~SaySomething + Pit lane camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 21a5d653-dd3b-4c4f-8012-c35e6b8e21fc + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5c49e541-cac4-4907-8bfb-c7adde0b214e + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + a23199a2-a9d2-4922-9ebd-2270c3a4da18 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 3e7a735a-13de-4a36-8430-7854774be0d6 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f2777bed-da96-4d14-9d81-ca7cd611f01b + [change; set;] [camera;] [to;] pit lane 2 [camera;] + + + false + false + 0 + + 0 + false + false + 0 + a612b23a-0363-43c3-a84e-fd7338c9e1e1 + TextSet + 0 + 0 + + ~~NewCamera + Pit Lane 2 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 7d5346ec-c25d-4726-9de0-a168236255a0 + TextSet + 0 + 0 + + ~~SaySomething + Pit lane 2 camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1d2ae861-cd46-46b3-b8b5-87c245dc0050 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + efe74c92-8a2e-4b84-b7c1-97619df8aa77 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 03e69a48-d2a5-4215-8538-1ed61cf0c5fa + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + c2ad4411-e64e-4ed4-969d-d0bcdf09b4e5 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 34c17603-540e-406b-9b38-563e3b9ddaac + [change; set;] [camera;] [to;] rear chase [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 723d8e67-8f53-4936-b478-05ecf2648484 + TextSet + 0 + 0 + + ~~NewCamera + Rear Chase + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b576c3e5-1318-4cdd-899a-09ab8877758b + TextSet + 0 + 0 + + ~~SaySomething + Rear chase camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 63a9882d-acf8-4b67-a147-5fd2595bd547 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + e63a6eb9-72d1-40af-acc7-08b9ff71fa18 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 5892471a-a794-47a4-b5e6-64940a446e76 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + cc0a38d7-da78-483b-ab46-501bd1ce2ddd + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 79d170f9-cdd0-4295-8f5c-0dcf024352d0 + [change; set;] [camera;] [to;] right front [suspension;] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + d30ded35-fc92-46e0-a08a-67062dd97ec6 + TextSet + 0 + 0 + + ~~NewCamera + RF Susp + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + f7d5cd8a-d118-4650-a835-43b76958804a + TextSet + 0 + 0 + + ~~SaySomething + Right front suspension camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 268feadb-ce06-4f36-aa61-02b55b17896f + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 7a730812-72cd-468c-9526-232e6f789d32 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + e465db04-91d1-4a01-9cae-9f1831dc9e79 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + b4c32313-9da7-426b-a2e2-1d61137d9147 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 0e472145-ba4a-4c04-9a15-f8d27f0855a4 + [change; set;] [camera;] [to;] right rear [suspension;] [camera;] + + + false + false + 0 + + 0 + false + false + 0 + c65725c3-f7f7-4bc6-a3ec-86ed2b3257c7 + TextSet + 0 + 0 + + ~~NewCamera + RR Susp + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b6c74729-a12d-4d99-8030-a86fdb937072 + TextSet + 0 + 0 + + ~~SaySomething + Right rear suspension camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6cf289bd-1c63-4574-9743-1ba8189e5436 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 40671b06-0b45-474f-ad4a-d4559e103b15 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + be523b8f-989d-496a-9180-9737bf8650f4 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 1147d40f-0628-465c-893e-410ddfe6dcf5 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 708665ce-efc1-4a1b-b24f-333facf481e4 + [change; set;] [camera;] [to;] scenic [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 40529b18-ec1f-4d60-87a2-ade2722948d7 + TextSet + 0 + 0 + + ~~NewCamera + Scenic + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 22968555-c223-4fb6-80a9-a3af7d9dd6ad + TextSet + 0 + 0 + + ~~SaySomething + Scenic camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + ee6da28e-47c5-4134-9280-91b82491a427 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c0051dd7-f3dd-4593-a622-5d0010059b59 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 6420a19a-2428-4f62-8991-95084c1548ca + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 0394c973-92b4-46b9-8627-6169da73b539 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + cfbe5d57-39d6-4cbd-afbb-81e4edef3f99 + [change; set;] [camera;] [to;] TV mixed [camera;] + + + false + false + 0 + + 0 + false + false + 0 + 7dc86e62-75b3-48d4-b4b4-2735d397b211 + TextSet + 0 + 0 + + ~~NewCamera + TV Mixed + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 25b797ea-1b20-4d3e-9be4-86b4931837b0 + TextSet + 0 + 0 + + ~~SaySomething + TV mixed camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 770ab30b-aea6-48fd-9dbd-3570f39ef84c + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9ecee34b-e923-4468-99cb-83f1eb36ab82 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + f37e391c-8e8d-4009-b63a-e684951839b4 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 8e3e2914-ba38-47bd-a624-e8805ec3ec80 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 5a713391-15f6-42a9-88af-5ba443586771 + [change; set;] [camera;] [to;] TV static [camera;] + + + false + false + 0 + + 0 + false + false + 0 + e42d4504-4c67-41e0-850a-d5513e9d6cd1 + TextSet + 0 + 0 + + ~~NewCamera + TV Static + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c3672dc3-2b8e-413b-ac9b-b4c8267ed871 + TextSet + 0 + 0 + + ~~SaySomething + TV static camera + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9be4e79b-d378-4429-81a7-78cdf89540a8 + ExecuteCommand + 0 + 0 + + f2f396e2-9935-48cf-9250-db2c2dda5e8a + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + fadb0009-cbc6-4fc5-801b-94700ed9fcf2 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A3 Cameras + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 1985c26f-dca1-429c-8a9e-02cf5756f42a + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + bad9e6c2-9af7-497b-b618-633e90fffd1f + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 376a90dc-f212-4bdf-ab08-a77385d30b5a + [Initialize; reset; re-initialize] [Pit Girl;] [plugin; data;] + + + false + false + 0 + + 0 + false + false + 0 + ebf6ec7d-0e22-4a6f-9a45-36d95bb25ef6 + IntSet + 0 + 0 + + 5 + 0 + 0 + 0 + ReplayBufferSecs + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + bad08717-9542-4b09-a3c5-ca600e7f74a0 + BooleanSet + 0 + 0 + + SayAnything + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 84cd226b-d2a4-4187-8462-b6de8a323ab1 + BooleanSet + 0 + 0 + + SayAnnouncements + + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 167ad23d-8e4f-45ea-904c-8df7c2117f1c + WriteToLog + 0 + 0 + + Robertsmania PitGirl Plugin Configuration Loaded + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 1b92a054-34b6-44ab-b036-9e109cb49a54 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 2e20561c-c9ae-404c-9eae-4926fc66b38c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + d03bc314-a4a0-4def-8b3d-be76c0893f84 + [jump; go; switch; watch; return; show] [to;] [the;] [race;] [start; beginning] + + + false + false + 0 + + 0 + false + false + 0 + 0441f434-2787-4012-ad7f-c134d025e236 + TextSet + 0 + 0 + + ~~SaySomething + At the start + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 64b30501-0bf9-4e6a-bd0c-5aa206e32c57 + ExecuteCommand + 0 + 0 + + 17762d1f-05c0-492a-be18-f26cd303d23f + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 63d1f84a-72d7-45c9-ba81-1c42f9645697 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 55837a21-3c16-4885-9bb6-01350709e883 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 9c3ff075-fa48-478c-80d6-756f249eb3ec + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f7d176b6-3c46-4e93-9e28-b6980acc81c9 + [jump;go;switch;watch;return;show] [to;] [whats happening;] [live;real time;now;the present moment] + + + false + false + 0 + + 0 + false + false + 0 + 7ed9d4e4-29d9-427e-803d-f24fdca7f9d3 + TextSet + 0 + 0 + + ~~SaySomething + Now is all there is + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 04f2d83a-a536-4d26-bcba-8b01c7abad04 + ExecuteCommand + 0 + 0 + + 20c212d5-8207-4504-af94-3d970cb8bc16 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + fd37a10e-e47a-483c-83ce-c2cc8994894c + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 4b0c010c-5334-4ba4-a71b-d82e7d29074a + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 9a597912-7116-4ade-97db-5f8d10da305e + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + ee82f915-fa1c-4516-b219-8b6e22bc25b3 + [Marker summary; Summarize markers] + + + false + false + 0 + + 0 + false + false + 0 + 599ddb2f-990c-43fa-b14c-f420e68896cb + ExecuteCommand + 0 + 0 + + 99d6c896-3ca8-45ed-8448-54e67a3644c4 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 064aaf7e-70b0-4dee-988e-c41224c9aa27 + TextSet + 0 + 0 + + ~~SaySomething + {TXT:~~MarkerSummary} + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + eee405a3-3672-465f-b89a-4a13909061a9 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 92c5fd9a-cbb5-44c9-85cf-5024fa0d0f90 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 7d0b0bfb-a6ae-4c61-b4b0-e720f454f562 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + e357baf7-267d-487b-9be8-1280e0f543c8 + [show; watch] most exciting + + + false + false + 0 + + 0 + false + false + 0 + d9864f89-0296-42e2-834c-170eb636b555 + TextSet + 0 + 0 + + ~~SaySomething + Show most exciting + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 3a83a6dd-1636-4c91-979e-f7a244a5b76f + ExecuteCommand + 0 + 0 + + 93b6e65b-973c-4372-9a76-3f09c00ff76e + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + eb4bb0cf-432a-4fd9-a5f4-bb0102c28224 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 5bdfd70b-d755-4e60-b9ba-fccf75e9c939 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + a87245df-13d1-4487-a1dc-6e71265fbf80 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + b5f2343f-51bc-4f7b-a620-4fbe54b68da6 + A0 ir2pitgirl - Check Car Number + + + false + false + 0 + + 0 + false + false + 0 + ce861784-f1db-4d3f-8d86-ce070895070a + WriteToLog + 0 + 0 + + Checking CarNumber: {TXT:~~CarNumber} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 41532c63-2857-4a3c-8606-2794ea842463 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Check_CarNumber + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9d67215e-11c7-4536-a4a3-3fd6e09b0c1f + WriteToLog + 0 + 0 + + After Check: {TXT:~~CarNumber} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 4cb2698e-2ebf-4e99-929e-6f7e9aff4c98 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 055670e8-f31e-4507-aebc-efba264b30c7 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 02724c04-89e0-4c95-b2c7-e91f21944067 + A0 ir2pitgirl - Check Car Position + + + false + false + 0 + + 0 + false + false + 0 + 98643c45-82fc-4896-b811-bb95d65a0767 + WriteToLog + 0 + 0 + + Checking CarPosition: {TXT:~~CarPosition} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + e3812559-06bc-48da-bdd2-9f6a60fa08a6 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Check_CarPosition + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + bdc5e5c9-19d6-4e93-bf3f-09d0d10d3a65 + WriteToLog + 0 + 0 + + After Check: {TXT:~~CarNumber} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + d5b09f39-b946-461d-9b63-a5fbbbaac468 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 5ecb0d6a-b60a-459e-9ebb-16ff80d9bd15 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 54e5dfeb-55b7-4281-bbb3-dc94daa53e19 + A0 ir2pitgirl - Get Camera + + + false + false + 0 + + 0 + false + false + 0 + 46359cdb-ed65-4588-9c13-1c524a62a4ac + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Get_Camera + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c1154213-e6ea-4cc1-aa10-4496fe85d02d + WriteToLog + 0 + 0 + + Get Camera got: {TXT:~~HoldCamera} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 851da769-2a2a-4a48-b7c0-df6487b7d7e1 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + cacea877-d768-48cf-be8d-e5f03d09d367 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 17762d1f-05c0-492a-be18-f26cd303d23f + A0 ir2pitgirl - Jump To Beginning + + + false + false + 0 + + 0 + false + false + 0 + 04324cb3-eabf-4dcf-b36b-9eb6c73e1295 + WriteToLog + 0 + 0 + + Jumping to beginning of recording + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2436e30c-f127-4b56-942f-eb14e3935f5d + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Jump_ToBeginning + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 3db7545a-4e8b-4518-97e5-395d005d6f5a + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + b6892d64-6d96-48a2-9f22-6d3d2ed2df09 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 20c212d5-8207-4504-af94-3d970cb8bc16 + A0 ir2pitgirl - Jump To Live + + + false + false + 0 + + 0 + false + false + 0 + c99687eb-f69c-420e-9e7b-54c3e97b0ef8 + WriteToLog + 0 + 0 + + Jumping to LIVE + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 577134a4-9e2f-4697-83c4-c60d055497af + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Jump_ToLive + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + e6524eeb-2db8-4016-a9e1-b85c6544cdaa + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + f6ccc48d-aadd-4df0-8dc8-f47ab96d0b0c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 7b6c6d75-8052-425c-a124-076fd2e863ed + A0 ir2pitgirl - Marker Add + + + false + false + 0 + + 0 + false + false + 0 + f83f7140-d741-4c3f-84c9-693b3465fa73 + WriteToLog + 0 + 0 + + Marker Add + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 3038401c-3c8d-4e85-8c3a-d30242944f0b + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Marker_Add + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + e2e3195b-0bf2-451e-a233-850bd2b607d8 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 07594c22-d087-452a-b4bc-7ef0a9fb181b + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 2f60554a-70d5-40e0-be7e-ddc84ae790a4 + A0 ir2pitgirl - Marker Count + + + false + false + 0 + + 0 + false + false + 0 + cdf8da5a-a64a-4986-9104-796bdfc05a18 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Marker_Count + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 03577fa0-5111-4e1a-b2f8-4ecd50e143c4 + WriteToLog + 0 + 0 + + Marker Count: {INT:~~MarkerCount} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + b47c976b-b6fe-4572-b854-3d21cace9454 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 4747a313-7382-4691-86d7-c36699d4c41c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 99d6c896-3ca8-45ed-8448-54e67a3644c4 + A0 ir2pitgirl - Marker Summary + + + false + false + 0 + + 0 + false + false + 0 + cb94feed-d0a5-497e-8c25-70ff56bd1cff + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Marker_Summary + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2f902010-1914-45d5-bf3d-71a88029fc4a + WriteToLog + 0 + 0 + + MostManualsCarNum {TXT:~~MostManualsCarNum} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 72f274c7-e09f-4b02-9315-7cf4c3970574 + WriteToLog + 0 + 0 + + MostBroadcastsCarNum {TXT:~~MostBroadcastsCarNum} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 567c5b9f-b239-42b8-80a7-253dfe64b95c + WriteToLog + 0 + 0 + + MostIncidentsCarNum {TXT:~~MostIncidentsCarNum} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + ed25c526-48f0-4012-a09c-fa7fc7077c09 + WriteToLog + 0 + 0 + + MostOvertakesCarNum {TXT:~~MostOvertakesCarNum} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1d798127-7b52-476d-a833-e9643d4a4e26 + WriteToLog + 0 + 0 + + Marker Summary: {TXT:~~MarkerSummary} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 851f7579-91a0-4402-9654-1875b551f290 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + b184698a-3975-4044-9f72-6d28da202036 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 74811aca-f781-46b0-baaa-c24ddcf7f9a8 + A0 ir2pitgirl - Marker Summary Car Number + + + false + false + 0 + + 0 + false + false + 0 + 037cd6c9-104e-490e-acfb-d1d2c709ec09 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Marker_Summary_CarNumber + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 3cafeff7-84bb-491a-bd1c-56ebfd81c79d + WriteToLog + 0 + 0 + + CarNumber Marker Summary: {TXT:~~CarNumberMarkerSummary} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + a5d0a87e-d1ac-440f-a8d7-3df12ff15147 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 3a4e7cd6-a138-4b3e-8013-cde74403d1b4 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + d413eb47-e8e4-4642-8e83-786249c53260 + A0 ir2pitgirl - Play iRacing Incident Next + + + false + false + 0 + + 0 + false + false + 0 + ba7d0c24-32ea-4f1b-a0a2-f57d45ecdc94 + WriteToLog + 0 + 0 + + Play Next iRacing Incident + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + e4fd480e-dd43-4ba6-aff7-8b6a131b902f + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + iRacingIncident_Next + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + false + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + false + irsdk_ir2pitgirl + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 8a7e0d4d-6cda-4989-aafd-ae9c4d049507 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 638b6156-b77f-4776-85eb-d984673cdf87 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + c0a7b00a-2566-4cb0-87d2-a5c4c8f54b57 + A0 ir2pitgirl - Play iRacing Incident Previous + + + false + false + 0 + + 0 + false + false + 0 + b0a45780-4f18-4f88-8ae2-1c89539d5f39 + WriteToLog + 0 + 0 + + Play Previous iRacing Incident + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2a3dcef9-1cd8-47ab-9709-5ec725cc71e9 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + iRacingIncident_Previous + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + false + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + false + irsdk_ir2pitgirl + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + b3160896-3a1d-4584-8f93-323774d40169 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + ab4f2a26-6643-4174-8c77-7fd1b065f869 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + fdcfbe90-d0be-4324-9554-3f60b8e9fe78 + A0 ir2pitgirl - Play Marker First + + + false + false + 0 + + 0 + false + false + 0 + 117a2307-e38d-4aad-aafc-f9ce147923fa + WriteToLog + 0 + 0 + + Play First Marker + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 4a8b86a5-f17e-4f2b-b362-08eaaaf9f96d + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + PlayMarker_First + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 827a89c3-2635-4d1a-bf39-3c4c30197752 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 929869c3-c1dd-4c6d-9733-8304bd7661a7 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + bcfdfaf2-dc3c-46d6-b168-3d888eb38131 + A0 ir2pitgirl - Play Marker Last + + + false + false + 0 + + 0 + false + false + 0 + a5fe2a32-ab7f-44c5-8909-4023a4960036 + WriteToLog + 0 + 0 + + Play Last Marker + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d76f677f-9c11-4fa9-8949-e042acc0d6f6 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + PlayMarker_Last + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 85023b68-8e62-4ba9-9fdb-a073a91e0d97 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + ad035243-947c-4319-ae52-cbf1f5446733 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f29f1d5b-6290-4591-b0f1-1d4e89759bd8 + A0 ir2pitgirl - Play Marker Next + + + false + false + 0 + + 0 + false + false + 0 + c2d68284-02d4-49a1-a944-146c216b0ad3 + WriteToLog + 0 + 0 + + Play Next Marker + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 4717aa5d-318b-4d8e-87a5-c6a536912552 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + PlayMarker_Next + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 3316e695-1c58-417e-acb0-bfa1f1998306 + ConditionStart + 0 + 0 + + + 0 + 0 + 0 + 0 + 4 + 1 + ~~MarkerType + 8 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + f63ed0f0-0e35-44e6-9d33-b06c267e7b41 + WriteToLog + 0 + 0 + + MarkerType: {TXT:~~MarkerType} Driver: {TXT:~~MarkerDriver} + 6 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + df689c03-fd4e-4834-b4c2-e9b6578cb4d8 + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + false + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + false + irsdk_ir2pitgirl + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 6f783fe2-39e1-4575-a12c-cfb7d6172e33 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 08617f56-ac50-4508-9833-1d7185217df7 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 3dde3790-14ca-4028-a190-cce81cdb266b + A0 ir2pitgirl - Play Marker Previous + + + false + false + 0 + + 0 + false + false + 0 + 90702757-cdbb-44d0-9473-569bf8377988 + WriteToLog + 0 + 0 + + Play Previous Marker + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 7b27313b-041b-4f46-971d-0f190db8817b + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + PlayMarker_Previous + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6194ca93-5214-41ae-9ba9-5f7040ecd136 + ConditionStart + 0 + 0 + + + 0 + 0 + 0 + 0 + 4 + 1 + ~~MarkerType + 8 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 816f743f-5fdb-4cbf-8230-2045edc44100 + WriteToLog + 0 + 0 + + MarkerType: {TXT:~~MarkerType} Driver: {TXT:~~MarkerDriver} + 6 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 33d3d760-0fda-4641-b044-d7e7bf7051d9 + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + false + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + false + irsdk_ir2pitgirl + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 911e4068-0e56-4054-877c-6695baf6abaf + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 52e37ea4-03b3-43b1-9212-10b4ecc0d91e + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 2c651e35-05d8-4af1-9731-a2a9b8b40e12 + A0 ir2pitgirl - Replay Car + + + false + false + 0 + + 0 + false + false + 0 + 136994e5-85a4-4e54-9f26-14cac317d90a + WriteToLog + 0 + 0 + + Replay Car {TXT:~~CarNumber} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + cad2c4cf-ba4b-4386-bfbe-574f488cc23a + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Replay_Car + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + df1c9ff5-ed32-4ea3-9d5c-753d80557fd7 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + e1241852-a27a-42b6-86a4-1a8911840993 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + ff4acaab-e500-4597-b29e-ad6887a3a3c3 + A0 ir2pitgirl - Replay Race Start + + + false + false + 0 + + 0 + false + false + 0 + 7ef1dbb3-7ba3-4377-8911-64cdef0ec7e7 + WriteToLog + 0 + 0 + + Replay Race Start + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 767cc01c-2391-4c36-9ff7-04f385e5db5e + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Replay_RaceStart + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 628a0524-4702-4ae0-8d76-b05d27c7bdf7 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 7a52f496-b54a-4ec4-8981-bafa22fae62d + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + eb385b27-4f0c-4f6b-a0af-5c68ed02355c + A0 ir2pitgirl - Seek Marker First + + + false + false + 0 + + 0 + false + false + 0 + b661fa94-8361-445e-8bf2-0cf84407340e + WriteToLog + 0 + 0 + + Seek First Marker + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b9163c3e-ee1e-4faa-b929-eda6b22744c4 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + SeekMarker_First + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + c9680b79-dd1b-4f87-bfa1-273b9c58a229 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + feb509dc-c8fd-4316-8d8b-cfde20eb189c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f2f396e2-9935-48cf-9250-db2c2dda5e8a + A0 ir2pitgirl - Set Camera + + + false + false + 0 + + 0 + false + false + 0 + b55d26ae-45ca-4857-8884-f7ab0d63e723 + WriteToLog + 0 + 0 + + Set Camera: {TXT:~~NewCamera} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9aaac657-cb9a-4a22-b08e-db8d07950419 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Set_Camera + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 6ae1dc5f-bf38-4b4b-8792-435b8e70c3cc + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 1e663947-ea66-4c10-95f4-adc7fcb9c916 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + e324a51d-3384-439b-b16c-33260d029889 + A0 ir2pitgirl - Speech Coordinator Check ttsspeaking + + + false + false + 0 + + 0 + false + false + 0 + 0494d3be-ca41-4976-a21b-4c10ebc48f32 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + SpeechCoordinatorWS_Check + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + a9364341-9699-4fbd-82f2-ea7476c51c1a + WriteToLog + 0 + 0 + + SpeechCoordinatorWS Check success: {BOOL:~~SC_success} DRE_ttsspeaking: {BOOL:DRE_ttsspeaking} msg: {TXT:~~SC_message} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + true + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + de10835b-b6ba-4e07-8673-53d2092aa4ac + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 9fb946e1-4ea7-445f-a68d-c0d37567879d + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 3edba5b8-e674-428e-bc10-a6788f8a7e11 + A0 ir2pitgirl - Speech Coordinator Clear ttsspeaking + + + false + false + 0 + + 0 + false + false + 0 + 4b06a51f-e9c8-47b4-86f0-61c95b2f02b4 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + SpeechCoordinatorWS_Clear + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8c4d9fc8-0c36-4b5b-96ed-51d515086dcc + WriteToLog + 0 + 0 + + SpeechCoordinatorWS Clear success: {BOOL:~~SC_success} DRE_ttsspeaking: {BOOL:DRE_ttsspeaking} msg: {TXT:~~SC_message} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + true + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 948e7935-8735-4439-9ed4-b5401d3fd07b + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 9ebdc03a-574c-4594-a388-cd003be33e8f + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 7d13a502-8e90-4372-8d32-54b22e295f1b + A0 ir2pitgirl - Speech Coordinator Set ttsspeaking + + + false + false + 0 + + 0 + false + false + 0 + a6ae1c93-d328-4ac2-a049-bbb3fc226916 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + SpeechCoordinatorWS_Set + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + cce4137a-c189-4cd7-8283-da94e149f401 + WriteToLog + 0 + 0 + + SpeechCoordinatorWS Set success: {BOOL:~~SC_success} DRE_ttsspeaking: {BOOL:DRE_ttsspeaking} msg: {TXT:~~SC_message} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + true + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + f8349423-1bdd-4a31-aa29-67aa00302b70 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 649bc64f-3ae8-4acb-9dab-d871b8c89801 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 2c3e3151-608b-4df6-8e70-2919fe2954b5 + A0 ir2pitgirl - Speech Coordinator Test Server + + + false + false + 0 + + 0 + false + false + 0 + d1a2c076-c758-48a0-bd85-d5e187b7e84a + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + SpeechCoordinatorWS_TestServer + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 02e8cfb2-bae7-4d8b-a342-d0ab76d48ee1 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + bd699d6a-4a07-4017-9ba6-98c19bb23c14 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 9fa03112-3129-4061-840c-aa64b35ca83d + A0 ir2pitgirl - Watch Car Number + + + false + false + 0 + + 0 + false + false + 0 + ed82dcd3-c3e8-4558-ad37-24351c341241 + WriteToLog + 0 + 0 + + Watching car number {TXT:~~CarNumber} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + true + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d2c6c9d9-fe80-4fd3-8519-e360737f510c + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Watch_CarNumber + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 5687ca8a-656d-4187-aa6e-f8aff4b1165e + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 6d63130d-56ab-4011-b536-09aa39666d93 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 4256496f-42e3-4aeb-b0f9-443e9a25f53d + A0 ir2pitgirl - Watch Car Position + + + false + false + 0 + + 0 + false + false + 0 + 0307d88d-05d8-44e4-ba2a-fa1cda040d61 + WriteToLog + 0 + 0 + + Watching car position {TXT:~~CarPosition} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + true + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 732485cb-d9e4-4ba2-8b40-5717f73dacbb + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Watch_CarPosition + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 741ba032-301f-48b4-96b6-6cd626f96d00 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + fb4d1cd5-2b79-4176-a434-ef95dd1a1486 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 93b6e65b-973c-4372-9a76-3f09c00ff76e + A0 ir2pitgirl - Watch Most Exciting + + + false + false + 0 + + 0 + false + false + 0 + 89612f51-b742-492a-9074-f9ad93978d34 + WriteToLog + 0 + 0 + + Watching most exciting + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 278d3c1d-f0d5-4ad7-9232-96504e232525 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Watch_MostExciting + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + f4ca8fa5-78ee-4ffc-a851-48d28f9914b7 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + a73004e0-b64d-4e69-8c2f-ea37bb8c14fa + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 599a680d-0445-4632-848e-497b981dbaa7 + A0 ir2pitgirl - Watch My Car + + + false + false + 0 + + 0 + false + false + 0 + a567b0c5-4378-4ab2-8cf6-e915f6160e33 + WriteToLog + 0 + 0 + + Watching your car + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1c2b2e6e-b440-4b07-9491-353ae99c6d79 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Watch_MyCar + 1 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + RobertsmaniaPitGirl Plugin Commands + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + b6398bba-42db-4b18-9bde-e8040e688b1d + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + f4ab4ab7-3688-464a-b068-94c2c128349a + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 59a2055a-e380-42e0-be68-02186535f3c0 + A1 SaySomething + + + false + false + 0 + + 0 + false + false + 0 + 2bef8e09-e851-4b8d-b709-a481918595ba + ConditionStart + 0 + 0 + + 0 + 0 + 1 + 0 + 2 + 1 + SayAnything + 0 + 1 + 0 + + 2 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + eee61516-ebec-4940-ba83-8af6830339ed + Say + 0 + 0 + + {TXT:~~SaySomething} + 00000000-0000-0000-0000-000000000000 + Default + 100 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + f1c3c697-b9f1-4e37-a2a3-5e76a3aeeb36 + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A5 Speech + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 998913c2-bb41-4d65-9924-42dce5a88881 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 4fffaf00-a454-490b-9669-729c17bbd16a + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 10194576-b9e1-42e4-88bf-9b9548abcb4b + B1 IRKEYPRESS_NEXTCAMERA + + + false + false + 0 + + 0 + false + false + 0 + ec3e92e2-8d69-47fe-9c0b-8a8263c329bf + PressKey + 0.1 + 0 + + 67 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + C1 iRacing Keypress + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 604002ce-8056-4ae2-994c-82af9d819301 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 9cda639f-16ad-4d15-8c08-0196c40ddd95 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 0cdff7f3-df15-40a3-9a4f-de97caa63751 + B1 IRKEYPRESS_NEXTCAR + + + false + false + 0 + + 0 + false + false + 0 + e01d60a7-2686-4483-b4d1-30755253b02c + PressKey + 0.1 + 0 + + 86 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + C1 iRacing Keypress + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 7300ed4a-2c1c-4b68-907d-bb8d83fee6b8 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + d615d8fa-0d5a-4d0b-9136-cdb622b0f7f0 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 45f3a1af-abd3-42f7-abd2-0b92d3686c12 + B1 IRKEYPRESS_PREVIOUSCAMERA + + + false + false + 0 + + 0 + false + false + 0 + c6ef25a9-dc93-4f20-b1a8-538b822a1981 + PressKey + 0.1 + 0 + + 160 + 67 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + C1 iRacing Keypress + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 81a83bc5-4399-42c2-aaaf-996d4f41dbd4 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 635418b0-3837-4349-9803-a96479ece800 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 1d13857b-d2d9-42ee-b8c8-6aab1d4800b7 + B1 IRKEYPRESS_PREVIOUSCAR + + + false + false + 0 + + 0 + false + false + 0 + 202e29d6-98dc-4022-9dc1-6be5291f6c8c + PressKey + 0.1 + 0 + + 160 + 86 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + C1 iRacing Keypress + false + 0 + 0 + 0 + 0 + 0 + true + false + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + e489d842-4e64-417a-a64e-020e66e89ccd + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + b0be3199-f4cc-4eaa-98a8-b3603ece3e9f + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 09c029a8-9f95-4fc0-bd2b-8adf7ee21e63 + Car ahead + + + false + false + 0 + + 0 + false + false + 0 + 71fbc64c-09fe-43cb-b8b4-b65ba8c216ff + PressKey + 0.1 + 0 + + 86 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 9 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 46933518-61b9-4cfc-98c7-f70006bcd921 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 4b914cbe-1647-488d-8a30-52830e5e26c4 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + ca069862-5636-48ec-b792-37c889f9b473 + Car behind + + + false + false + 0 + + 0 + false + false + 0 + a59ff9c9-7ed4-43d3-90e7-aab05e4a45ff + PressKey + 0.1 + 0 + + 160 + 86 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 8 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 40d5e9b1-bf9b-46bc-bdda-72a876888a85 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + c0767a9a-27b0-4fd5-8fe0-945fb77da235 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 2c3f989a-054b-4871-8405-b63000bb51a2 + Clear [the;] Marker [Filters; filter] + + + false + false + 0 + + 0 + false + false + 0 + 7945bbd8-6521-443c-9267-60305e3838a1 + WriteToLog + 0 + 0 + + Markers Filters Cleared + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5e20063e-2b9a-4657-bb50-64e29422a23b + TextSet + 0 + 0 + + ~~SaySomething + Marker filters cleared + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6cc1764e-cee2-4d29-b688-fc27dde117b6 + TextSet + 0 + 0 + + MarkerCarFilter + -1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 90ea8737-e692-442a-9773-90014451a34e + TextSet + 0 + 0 + + MarkerTypeFilter + Wildcard + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b24be06f-7540-4885-9847-7337bf392a5d + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 0f272c00-2f39-468d-9e02-834c3d091bcf + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 3c337173-811a-41f8-b5b5-5cbcdd8ed5c6 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + e5e81325-8ef6-4590-84a0-6827763b4c2e + Clear [the;] Marker Car [Filter;] + + + false + false + 0 + + 0 + false + false + 0 + 38528a25-027f-46cc-8aff-42c562c638d0 + WriteToLog + 0 + 0 + + Markers Car Filter Cleared + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5a031dca-cc11-4af5-80f8-562c86ab9914 + TextSet + 0 + 0 + + ~~SaySomething + Marker car filter cleared + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 54b30e5a-04c9-43d4-9db5-724c3d86f6ce + TextSet + 0 + 0 + + MarkerCarFilter + -1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + ed8713a3-342c-42d4-bb2e-d36118baf2fb + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + fba3caa9-5511-4269-ac54-76a368232123 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 9729c15e-0d01-4d5a-865c-8c29c6dedaa5 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 8eed5fad-0241-4be2-b61c-9d894f1a360b + Clear [the;] Marker Type [Filter;] + + + false + false + 0 + + 0 + false + false + 0 + 3a929c5e-a0ad-456b-9cab-ea46e24d7865 + WriteToLog + 0 + 0 + + Markers Type Filter Cleared + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + db82f9a8-3106-4534-be15-b300436e85ed + TextSet + 0 + 0 + + ~~SaySomething + Marker type filter cleared + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 243d1d0d-b09f-4208-b8e0-b301e4fa12ee + TextSet + 0 + 0 + + MarkerTypeFilter + Wildcard + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 4a5174d6-44dc-41cd-9abc-108d82f7c7d4 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 9e9fd466-149f-4fc4-a326-0d2e5d849a57 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 5a16403b-5756-4f26-abec-cf57692d3a68 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 24d5c9df-3fb1-465e-bd10-26109cda5ead + End of recording + + + false + false + 0 + + 0 + false + false + 0 + 680e9779-f560-41bc-a53f-2a07a9b85990 + PressKey + 0.1 + 0 + + 97 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + d4a7af7f-c067-4065-857c-70e12f2afdc1 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 4ebd545a-a793-4e46-bccc-9d2a5219a890 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 19aecfb8-2854-4190-abf3-404e89ec9f9a + Fast forward + + + false + false + 0 + + 0 + false + false + 0 + 14f016e0-9be6-4545-8c85-856a054465cd + PressKey + 0.1 + 0 + + 160 + 102 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 129 + 0 + -1 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 55c6fb63-4248-4e5b-8611-3196f44d9e9e + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + e7daaffb-5f88-47c2-97c2-76fab8cca1df + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + aac13f82-6ca1-458f-9202-326695cf9407 + Filter markers [by; for; with;] [my car; me] + + + false + false + 0 + + 0 + false + false + 0 + 74dd87c7-6722-4fa2-acdf-6ad6d5debe4a + WriteToLog + 0 + 0 + + Markers Filtered by Your Car + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + bfdf3d24-aef2-4814-a1bf-8e02fafd331f + TextSet + 0 + 0 + + ~~SaySomething + Showing markers for your car + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 57ad861f-4a27-41c6-b742-903eaa717619 + TextSet + 0 + 0 + + MarkerCarFilter + -4 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6fc0bf77-8653-4e76-a502-6989ba55ce0a + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 73aaae2b-9a77-4b86-93ed-e3bfc4f59dee + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + bd684725-47cd-4942-ac82-fce5124acab4 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f3dd7c8f-1375-4af3-bfd0-37f97cf40013 + Filter markers [by; for; with;] [the;] [current; this] [car; driver] + + + false + false + 0 + + 0 + false + false + 0 + 237f340b-24ba-4c70-9a57-1dfb07c9a1cd + WriteToLog + 0 + 0 + + Markers Filtered by Current Car + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 09b04dde-0797-46d8-b77c-3d2826c44956 + TextSet + 0 + 0 + + ~~SaySomething + Showing markers for the current car + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 556757cc-6ad9-4bed-8125-144350d36f4f + TextSet + 0 + 0 + + MarkerCarFilter + -100 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + e745d496-8e35-4e23-98c6-9ee49c79dc2a + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + f0e9c03e-c45d-40c9-b382-40a82ba48939 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 3077a7ac-8919-4e45-b727-44cf4591fcbf + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + cee1a34f-46f8-43fc-aafb-6b877db62ad8 + Filter markers [by; for; with;] car number + + + false + false + 0 + + 0 + false + false + 0 + 4a4a460f-5529-4390-9656-f0c210e7a944 + Say + 1 + 0 + + Which car number? + 00000000-0000-0000-0000-000000000000 + Default + 100 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6f2c4755-0a9e-43c6-8177-f814f3fb3c00 + WaitSpokenPrompt + 15 + 0 + + [1..65] + ~~CarNumber + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + ed252374-e00e-4197-aae5-eb5a3dab1025 + ConditionStart + 0 + 0 + + + 0 + 0 + 0 + 0 + 6 + 1 + ~~CarNumber + 9 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 33782e95-8581-4afe-bac6-5bd056bd09dc + TextSet + 0 + 0 + + ~~SaySomething + I didnt get that + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 12ffd517-198f-4663-99b1-e33a059e56b2 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 524041f2-3303-458b-90a2-ab5c51958324 + ExitCommand + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + eee47622-85b2-4080-9ec5-c35691be079e + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 26c3c682-706d-4133-a83d-7ef0b4de9a38 + ExecuteCommand + 0 + 0 + + b5f2343f-51bc-4f7b-a620-4fbe54b68da6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 49172db1-5910-4211-adab-8f6c11f726b7 + ConditionStart + 0 + 0 + + -1 + 0 + 0 + 1 + 0 + 12 + 2 + ~~CarNumber + 0 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2bd7a113-b8e5-4208-8dab-e179e8fedee2 + TextSet + 0 + 0 + + ~~SaySomething + Sorry, that car is not in the session + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 848d62a6-be4b-4895-a428-3908cbefc75c + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c8924504-0b06-4391-81b3-3ad2068e4b8b + ExitCommand + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 0384dd63-95ca-4cd5-a2a6-4a4e4e7ac3ac + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 8 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + fa2fb090-0925-4b6c-9829-973f51756233 + WriteToLog + 0 + 0 + + Markers Filtered by Car Number '{TXT:~~CarNumber}' + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b991cb83-2520-4fe6-aa39-aa37b013dd1a + TextSet + 0 + 0 + + ~~SaySomething + Markers filtered by car number '{TXT:~~CarNumber}' + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 22df9241-d708-4b6d-8918-0bd88273729a + TextSet + 0 + 0 + + MarkerCarFilter + + ~~CarNumber + + 0 + 0 + 0 + 1 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1e2baba0-89b3-4802-9ccf-c1d5b1a96ba3 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 4e449838-c23b-44ad-97b7-b82654444c09 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 1adc0595-3a1b-439d-82a9-bb1aec6bcdb6 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 79972ff4-5985-4d80-a4cc-05860a77bfc2 + Filter Markers [by; for; with;] Incidents + + + false + false + 0 + + 0 + false + false + 0 + 59e66c1b-c79b-44ac-a89e-52e5f4b395af + WriteToLog + 0 + 0 + + Markers Filtered by Incident + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 4260536b-6265-4509-b63d-8f7d1ad6454b + TextSet + 0 + 0 + + ~~SaySomething + Incident markers selected + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 63279520-28b7-4055-b5ce-a7c238b5cab9 + TextSet + 0 + 0 + + MarkerTypeFilter + Incident + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8d14d9ea-493b-494b-9731-af6c72dc63dc + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 3b858b5f-dc3a-41f8-a0ab-617257b54d0b + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 6ab7bf8e-fd1f-4e69-b03e-fbb446f5887b + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 5c5723bb-504b-4c45-9687-bca6eb073561 + Filter Markers [by; for; with;] manual + + + false + false + 0 + + 0 + false + false + 0 + 1a071274-61a2-4b0b-a567-c9323e7bdfc0 + WriteToLog + 0 + 0 + + Markers Filtered by Manual + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c1d16ff8-cf47-44e0-8fb2-87958ac54cb4 + TextSet + 0 + 0 + + ~~SaySomething + Manual markers selected + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + dc9a3790-d709-458b-a55b-965fb0702b9e + TextSet + 0 + 0 + + MarkerTypeFilter + Manual + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 993731a9-7e01-4741-b4ca-1f0822bde0c4 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 6f52f246-415e-43b5-8c22-66bea1395c8d + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 201a16d1-a28d-443b-9e72-7be2d04d0fac + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 947eca2f-e4a3-4975-a20c-461b6fbb32d7 + Filter Markers [by; for; with;] Overtakes + + + false + false + 0 + + 0 + false + false + 0 + 4fefe199-195d-437e-bb5b-49f354b19b5a + WriteToLog + 0 + 0 + + Markers Filtered by Overtakes + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 25df32f5-c24f-4c5f-b66a-6f5b3656fdee + TextSet + 0 + 0 + + ~~SaySomething + Overtake markers selected + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 24570d20-68f7-41df-90f1-f4412c7f0e9d + TextSet + 0 + 0 + + MarkerTypeFilter + Overtake + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + e6454fb3-4236-4e06-8b3c-60726a78080e + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + a27d005e-2d9f-40dd-815e-c2c87158ac08 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 1b15a4fd-0c7d-4fb0-a828-47be5d408f59 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + c76d07b5-ae2d-464f-8e69-37910850dbfa + Filter Markers [by; for; with;] Radio [broadcasts; salt; chatter; talk; transmissions;] + + + false + false + 0 + + 0 + false + false + 0 + 96bf275b-05a8-4bfb-ad0f-107466ecad1a + WriteToLog + 0 + 0 + + Markers Filtered by Radio + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 4814ba4e-6882-46e1-be27-7c71f3407620 + TextSet + 0 + 0 + + ~~SaySomething + Radio markers selected + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + cae3cb5e-134a-4a7c-8bce-048525bbbfb8 + TextSet + 0 + 0 + + MarkerTypeFilter + Radio + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 42ad6c6b-f2dc-442c-9780-30ce511707f8 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 4a977b1c-c3eb-4905-a723-90dc7b9d6f77 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 9af2d50e-d084-4449-8713-bb72e42271fd + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 7bca7bbd-261f-4cbc-ad3b-f16cbab1e4ed + Filter Markers [by; for; with;] Undertakes + + + false + false + 0 + + 0 + false + false + 0 + 5914ad40-575a-467f-9451-6d3b45746e0e + WriteToLog + 0 + 0 + + Markers Filtered by Undertakes + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 79955c3c-11c8-4fa7-9c76-4252a4de7cca + TextSet + 0 + 0 + + ~~SaySomething + Undertake markers selected + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c55676af-5c51-499e-b128-5d675872758a + TextSet + 0 + 0 + + MarkerTypeFilter + Undertake + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2ed2b2ed-9287-4eb5-9a35-18c309d48690 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 819e4092-247b-402d-94fc-d0917fe05e8f + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + fc086ff4-55a1-4170-91ca-5b0e882624a5 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + ad248fb1-90bb-4681-9d41-74b75495e6f6 + Frame backward + + + false + false + 0 + + 0 + false + false + 0 + 68c1bc7f-2b33-4a02-98d8-6fb7f3582052 + PressKey + 0.1 + 0 + + 100 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + b47ffe87-77dc-43e9-9199-d82ab6279a47 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + bf4e0795-ca87-4b59-8e3f-ddda3ac7cd1d + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 04a2940c-40b2-4553-a75b-4499d216682e + Frame forward + + + false + false + 0 + + 0 + false + false + 0 + d1efc915-4822-4c61-95a1-8f697294669e + PressKey + 0.1 + 0 + + 102 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 6ec85142-6867-4b95-87a0-e15fb78e2743 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + e0893e5b-3da9-4adc-af6f-877a1fff49c1 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + ab173510-947e-458c-b20c-bd5509ef751f + Next camera + + + false + false + 0 + + 0 + false + false + 0 + 351cc8b5-c992-4221-be64-5488535760a8 + PressKey + 0.1 + 0 + + 67 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 3 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 24f628e2-5e9c-497c-bd62-d8ef61f141ac + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 3c3a719e-426c-40fe-b18c-aa4a60a602dd + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 5c942d50-0e1e-4d4e-80e8-cb5fab7bba41 + Next iRacing incident + + + false + false + 0 + + 0 + false + false + 0 + 13f2fde7-5989-405d-8c4a-6e1db42a8d53 + PressKey + 0.1 + 0 + + 162 + 99 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + cc29ff47-a2be-458c-9a0d-26ef4642610f + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 3888006b-b690-4fe9-8dcc-7a355dd8e3a1 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 6e5568b4-d102-4a62-bc10-8a64d6ed169d + Next lap + + + false + false + 0 + + 0 + false + false + 0 + 03c4ea0b-ae41-408b-9da3-4cc3fb07c8eb + PressKey + 0.1 + 0 + + 160 + 99 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 5 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 387c6f6e-147d-4388-9034-722eabaf7c18 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 93036099-822e-43d9-bdaa-92f0ea43b128 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 65a44aaf-f59c-418c-ab25-bcd70edca32f + Next marker + + + false + false + 0 + + 0 + false + false + 0 + ccbf869f-0b7a-4546-9010-ee10a552423a + ExecuteCommand + 0 + 0 + + f29f1d5b-6290-4591-b0f1-1d4e89759bd8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8793000c-153b-4639-97dd-e1460d692a75 + ConditionStart + 1 + 0 + + 0 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + + + 962a79d0-9fdf-48c8-9ead-fd3f7e462b21 + 1 + ~~MarkerDriver + 0 + 0 + + 0 + 8 + + 0001-01-01T00:00:00 + 0 + + + 3932d7c1-19e0-445c-b325-1103692d4092 + 2 + SayAnnouncements + 0 + 1 + + 1 + 0 + 0001-01-01T00:00:00 + 0 + + + 12e6fc02-4324-462d-9859-c21889ed46bd + 1 + MarkerTypeFIlter + 0 + 0 + + 0 + 0 + Wildcard + 0001-01-01T00:00:00 + 0 + + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 19d0b1a3-f4c3-414d-9676-acd516b39fea + ConditionStart + 0 + 0 + + -100 + 0 + 0 + 0 + 0 + 4 + 2 + MarkerCarFilter + 1 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 59c7f988-060e-4890-97c3-ff7abdb86ce2 + TextSet + 0 + 0 + + ~~SaySomething + {TXT:~~MarkerDriver} had an {TXT:~~MarkerType} + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 4efa0ccf-d408-4d28-93b9-cc3398c4e516 + ConditionElse + 0 + 0 + + 0 + 0 + 0 + 0 + 6 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 3f72bf9a-5b34-495b-a3ac-b051a84c7e73 + TextSet + 0 + 0 + + ~~SaySomething + They had an {TXT:~~MarkerType} + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 35de5f4b-57c7-44e4-91ea-baf8b077c5cc + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 2 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 21d07571-c2ab-4265-802c-8bd2f33e64fa + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 874b306c-b917-4401-a26b-1d266df12a1c + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 2 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 77a3a9e2-cd42-400c-8840-fd073bba199c + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 700cf1f1-865a-413a-b9f2-b80097423d4c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + c94cd3cc-c61a-4b35-8808-5c910f932650 + Play Pause + + + false + false + 0 + + 0 + false + false + 0 + 2a4571db-6ccd-41e4-8d2d-6c823cb32b1f + PressKey + 0.1 + 0 + + 101 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 128 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 38f06bcb-93d7-4061-b034-076002e993bd + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 4f64dc7f-1d22-4663-b399-b6c1f5aba416 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 0334987f-5c26-4d3d-a911-86f2ed1680fe + Previous camera + + + false + false + 0 + + 0 + false + false + 0 + 43b0e0ad-b211-4fc4-8e14-54aeb2acf46e + PressKey + 0.1 + 0 + + 160 + 67 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 1 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 99fc6a7f-f45e-42b1-929a-929f71a74055 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + cf9cf665-1a3d-4063-957e-435b78e35c9e + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 553f4f09-3aa6-4598-beb3-923b409b4bc6 + Previous iRacing incident + + + false + false + 0 + + 0 + false + false + 0 + eaeb0fac-1f7a-48d5-96d9-7d4820a35126 + PressKey + 0.1 + 0 + + 162 + 97 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + -1 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 7dc8076e-4beb-4c12-b7ff-aca1284c4c25 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + a18148b5-07e5-4137-8606-7aa409c1c913 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + d8aa3c1b-ac39-4d61-a2fb-5774406e9c49 + Previous lap + + + false + false + 0 + + 0 + false + false + 0 + 947a570f-4635-431f-8fab-85be7be2571a + PressKey + 0.1 + 0 + + 160 + 97 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 4 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 91eb46eb-f141-4059-9e65-a7493e46d7f9 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + b91a6a21-ba0e-4108-8600-869c9d8e2ddb + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 64e6005f-d681-46c9-ac30-a97941efc124 + Previous marker + + + false + false + 0 + + 0 + false + false + 0 + f18c3af2-7051-4c21-9eb9-fe60e3278ac7 + ExecuteCommand + 0 + 0 + + 3dde3790-14ca-4028-a190-cce81cdb266b + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6915b225-4394-487a-80bf-ab05788b389c + ConditionStart + 1 + 0 + + 0 + 0 + 0 + 0 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + + + d4815805-918c-4da2-aacc-5c24fbbc1e44 + 1 + ~~MarkerDriver + 0 + 0 + + 0 + 8 + + 0001-01-01T00:00:00 + 0 + + + 89dfbb09-3246-4d55-8168-939c7a5639e2 + 2 + SayAnnouncements + 0 + 1 + + 1 + 0 + 0001-01-01T00:00:00 + 0 + + + e4785605-6806-44e0-b06d-db85f204c1b3 + 1 + MarkerTypeFIlter + 0 + 0 + + 0 + 0 + Wildcard + 0001-01-01T00:00:00 + 0 + + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 078b7095-9083-4ea8-8e94-41d9cfaacd87 + ConditionStart + 0 + 0 + + -100 + 0 + 0 + 0 + 0 + 4 + 2 + MarkerCarFilter + 1 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b7aaf913-3388-4513-827a-66332976f80e + TextSet + 0 + 0 + + ~~SaySomething + {TXT:~~MarkerDriver} had an {TXT:~~MarkerType} + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 90eea9a2-4222-4887-981f-7c34d4dc47a3 + ConditionElse + 0 + 0 + + 0 + 0 + 0 + 0 + 6 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + a57b6b2e-b6af-42c9-8d3f-febc3afa04a2 + TextSet + 0 + 0 + + ~~SaySomething + They had an {TXT:~~MarkerType} + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9cfcb756-ede0-48d8-b7b2-620150ccfb26 + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 2 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 563aa83e-24b7-47f1-8b49-a678742c96d3 + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 0 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 5915ef95-f08f-4d51-ae30-89048f3c3548 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 2d087adf-6965-4797-ada7-36775c44034d + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + a2d32b2a-d4ef-430d-89df-e13e36aa424e + Print Cameras + + + false + false + 0 + + 0 + false + false + 0 + 24a373bf-cafe-4255-b72d-1e2dc4e67d4b + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Print_Cameras + 0 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + B1 Debug + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 00000000-0000-0000-0000-000000000000 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 4acc8426-48bc-4336-b921-c91fa217c47d + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 3487b673-37a9-4b0c-b6ac-7e2db7649ec8 + Print Drivers + + + false + false + 0 + + 0 + false + false + 0 + 4cb64179-1e8d-4389-8a5e-1e943057b81d + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Print_Drivers + 0 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + B1 Debug + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + ced98d31-5227-4ae8-986c-8922c788a9f2 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 31d3f3d3-b66d-4f53-9d2d-6c62d24a80cd + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + a6f400f4-8d23-445c-bda7-1067c7f2e95a + Print Info + + + false + false + 0 + + 0 + false + false + 0 + 54cb4af1-f52c-40d3-9ce5-e5b2ad11d6a2 + ExternalInvoke + 0 + 0 + + BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13 + + + Print_Info + 0 + 0 + 0 + 0 + + + 0 + 0 + + 0 + 0 + 0 + + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + true + B1 Debug + false + 0 + 0 + 0 + 0 + 0 + false + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 00000000-0000-0000-0000-000000000000 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 1775fb3d-5210-4538-a627-d9e2cbf4f07e + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f877eecb-0bac-41e1-abdd-8623a289bede + Race Start + + + false + false + 0 + + 0 + false + false + 0 + 1398bd1b-d851-4195-99e8-2199f30a6560 + ExecuteCommand + 0 + 0 + + ff4acaab-e500-4597-b29e-ad6887a3a3c3 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 6 + 0 + -1 + false + false + false + irsdk_ir2pitgirl + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + cb365b1a-258d-4dcf-96fb-c0b36978b27c + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 5833e711-41e3-4bfa-8a1f-47d5ec17f581 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 1c13cfa7-2003-47c2-944c-89bd7e97887e + Rewind + + + false + false + 0 + + 0 + false + false + 0 + b1930d5b-a3b1-4540-ac19-0b6cfdd38809 + PressKey + 0.1 + 0 + + 160 + 100 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 131 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + fd367fd4-2e7b-4144-8e36-bec6f22eddeb + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 47efbe3d-75bc-4b12-b9bc-12d1f152d553 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 5570b3d3-e8de-44bf-a077-7a2c3baca4dc + Set [a; new;] marker + + + false + false + 0 + + 0 + false + false + 0 + c7b0cff2-b999-410f-9b3f-db773faeea59 + WriteToLog + 0 + 0 + + Setting a marker + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 132786e5-9ca9-45c4-8d3a-1ab096882522 + TextSet + 0 + 0 + + ~~SaySomething + Setting a marker + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c31f8586-66b6-4241-bfcd-abf6e38e690d + ExecuteCommand + 0 + 0 + + 7b6c6d75-8052-425c-a124-076fd2e863ed + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + a52c99fd-7fd5-426c-b611-ec3a8f81b65b + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A2 Markers + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 12ef60c5-dcd2-4118-a691-3911fa332371 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + a80f1bac-b94a-42f4-b1c1-4bd7bba4306c + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + ee804680-dcc7-48eb-8747-f2427144b0b9 + Show my car + + + false + false + 0 + + 0 + false + false + 0 + 39e107d1-73e5-4c77-9e24-cbe7a14de79f + ExecuteCommand + 0 + 0 + + 599a680d-0445-4632-848e-497b981dbaa7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 8 + 1 + 9 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 5c15df6f-d473-4878-ae63-a0982c2f701f + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 2771f382-52e7-46de-bf51-527f17920a56 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 10cb69cd-c7cc-47ff-861f-46b97361714d + Slow motion + + + false + false + 0 + + 0 + false + false + 0 + 81e66e57-e895-47e5-b341-f9c63bee346c + PressKey + 0.1 + 0 + + 104 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 130 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 53b3712b-547a-4088-a930-c5911a0c022d + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + d6ce6467-5b33-41a7-ad34-49c2f851eedb + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 96b5ab27-b5b1-46b9-ab26-ebfbe24ed5c4 + Toggle [say soething; say nothing; speech] + + + false + false + 0 + + 0 + false + false + 0 + d90ebe7c-ef50-4302-9145-b93b9771c5dc + BooleanSet + 0 + 0 + + SayAnything + + + + 0 + 1 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1922a823-fec9-4dc4-85a9-64a9c0307faa + ConditionStart + 0 + 0 + + 0 + 0 + 1 + 0 + 3 + 1 + SayAnything + 0 + 1 + 0 + + 2 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9eb6ebfd-4f57-4f60-abf0-76bb79c00c88 + Say + 0 + 0 + + Speech enabled + 00000000-0000-0000-0000-000000000000 + Default + 100 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 3be3217d-8fff-4bce-8e37-893111aa339e + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8852f96a-be35-4c1e-bac6-40bf56a79329 + WriteToLog + 0 + 0 + + SayAnything: {BOOL:SayAnything} + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A5 Speech + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + e08808ab-8c9f-44ff-a68b-1815aaf9a857 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 13b8008c-cb49-4016-a3fb-9da29b6af89f + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 92e543a7-85bf-4040-9d33-d83c823ff687 + Toggle [say;] announcements + + + false + false + 0 + + 0 + false + false + 0 + 49698c30-223a-4917-9672-cb83c03ae9b7 + BooleanSet + 0 + 0 + + SayAnnouncements + + + + 0 + 1 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 12c97340-dcb1-4855-800d-1554e1b517ea + ConditionStart + 0 + 0 + + 0 + 0 + 1 + 0 + 3 + 1 + SayAnnouncements + 0 + 1 + 0 + + 2 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6b2105e6-f289-4a9e-96f1-0e71639f3f7e + TextSet + 0 + 0 + + ~~SaySomething + Announcements Enabled + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c48c7045-6a80-449a-92c2-2726fae5febe + ConditionElse + 0 + 0 + + 0 + 0 + 0 + 0 + 5 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c5f43c4f-fd28-4bd9-b9d3-04b03713aaf9 + TextSet + 0 + 0 + + ~~SaySomething + Announcements Disabled + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d9d37b4e-a483-41b8-b632-7a626c72359f + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 76572348-01f0-407e-8bcf-7196f15f101b + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + a440beec-569e-491b-8e71-30feab09b8bc + WriteToLog + 0 + 0 + + SayAnnouncements: {BOOL:SayAnnouncements} + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A5 Speech + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 537b84ab-8fc5-4908-8fc8-94a7e4fef506 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 5b473b78-23b4-431f-b4bd-b4275e839f58 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + b16efb98-beed-46fd-9b79-22d5d36baa07 + Toggle Car [Marker] Filter + + + false + false + 0 + + 0 + false + false + 0 + c0a26c1d-be44-4112-b5fc-7ba9cc1d1f14 + WriteToLog + 0 + 0 + + Marker Car Filter: {TXT:MarkerCarFilter} + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 12b701c4-6bd1-4e32-830c-080d928efdd8 + ConditionStart + 0 + 0 + + -100 + 0 + 0 + 0 + 0 + 4 + 1 + MarkerCarFilter + 1 + -100 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c7a38151-18f8-4f48-a95a-f8d5c48832f7 + TextSet + 0 + 0 + + MarkerCarFilter + -100 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 61b706ee-81ca-4dd7-bad7-1240e25c8b06 + TextSet + 0 + 0 + + ~~SaySomething + Showing markers for the current car + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 27450005-ba89-47c0-984e-58c289eea69c + ConditionElse + 0 + 0 + + 0 + 0 + 0 + 0 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8d4b47d6-fa50-461b-a910-04c0ce8b0258 + TextSet + 0 + 0 + + MarkerCarFilter + -1 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 065b440b-9ebe-4a0d-9215-3fc37132483e + TextSet + 0 + 0 + + ~~SaySomething + Marker Car Filter Cleared + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 379dda3b-4565-49f5-a295-500319ccc88f + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2afa647f-88c4-4774-92ed-ab577db1a5ca + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A1 Replay Controller + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + true + 1 + 7 + 0 + -1 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 30c79e23-4531-4db1-ae1f-872c0128ccfa + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 4b9777cc-90bf-4dbe-ab68-ca2d4ca59a84 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f633b536-ce7f-49c3-bab5-3608a51324a2 + Toggle num lock + + + false + false + 0 + + 0 + false + false + 0 + d1fd3643-de15-40d2-b8b9-ff63e7e640cf + PressKey + 0.1 + 0 + + 144 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 0e6912e0-4697-4326-91bc-2a7fc43d0489 + TextSet + 0 + 0 + + ~~SaySomething + Numlock toggled + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d5b14783-3b1c-41b6-b170-2544bf8c6b97 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + C1 iRacing Keypress + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + true + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + d14e6767-02be-4486-a3c3-a9be557a4643 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + true + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 7221f18c-a5ea-439a-8daf-bf6e2ab66c50 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 7aa2b5f8-a30a-4479-a31f-f8422e5e1794 + Watch [my car; me] + + + false + false + 0 + + 0 + false + false + 0 + 29245a4a-bee3-4c5a-afc6-a1c8dc2e50cd + TextSet + 0 + 0 + + ~~SaySomething + Watching your car + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6f1552ee-bece-4fa6-9c5c-3aa404c4c6e0 + ExecuteCommand + 0 + 0 + + 599a680d-0445-4632-848e-497b981dbaa7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 2369f73b-2894-4528-9307-40d8d1e7a654 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + false + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + f72e1948-3f34-410a-838e-f6db8b5a9183 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 8e0d080e-8148-480c-95fc-c5d9352b1714 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + f26a27e4-f711-46d5-acca-23a205adf2e9 + Watch [the;] car ahead + + + false + false + 0 + + 0 + false + false + 0 + d6903e7c-802d-49cc-935a-dc10af5f5543 + TextSet + 0 + 0 + + ~~SaySomething + Watching the car ahead + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 25f9736e-17be-40f2-a5ba-bf2fa921e513 + ExecuteCommand + 0 + 0 + + 0cdff7f3-df15-40a3-9a4f-de97caa63751 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8325d65e-0580-4f30-a7b3-82d95994a610 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 175d97fa-a0d8-4698-8fa3-141d84cf4308 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + dae7a2fb-a259-4ace-9937-4191903dcb85 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 56730bb3-cab3-45fd-98fa-517803cb96bf + Watch [the;] car behind + + + false + false + 0 + + 0 + false + false + 0 + aa2b583e-7030-45da-ab61-5aa8702d8709 + TextSet + 0 + 0 + + ~~SaySomething + Watching the car behind + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d921dd6d-5060-4bf1-990f-a0d8b475ebbf + ExecuteCommand + 0 + 0 + + 1d13857b-d2d9-42ee-b8c8-6aab1d4800b7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + cffeb507-590f-4c3d-9730-4656812579ad + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 83f25534-6cfc-47cf-a4c9-4dfc9c123f28 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + 17ab223b-5b8b-4904-a4dd-de996d07eaf6 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + acb72d6f-7b3d-4346-88e8-8cca34dee0e8 + Watch car number + + + false + false + 0 + + 0 + false + false + 0 + 00fb82d3-742f-4655-b15e-da6ba6f15859 + Say + 1 + 0 + + Which car number? + 00000000-0000-0000-0000-000000000000 + Default + 100 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + ff0c1d03-0a85-4fc8-b73d-b9a91163573b + WaitSpokenPrompt + 15 + 0 + + [1..65] + ~~CarNumber + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b8d1e98e-1525-4faf-bd0a-b6fbc930e7fd + ConditionStart + 0 + 0 + + + 0 + 0 + 0 + 0 + 6 + 1 + ~~CarNumber + 9 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 23d9eb1e-abf8-4ad7-8f7d-242a8fa019d7 + TextSet + 0 + 0 + + ~~SaySomething + I didnt get that + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 43812936-174a-4d9f-a4c4-a7bf04f2e3b8 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 6db73f78-9cf0-466e-b4cb-18c002498810 + ExitCommand + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 241026fe-03ba-4e5c-b57c-ed8fbfc7b2c7 + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + eff6694c-0968-41f0-b928-8d1e42a40333 + ExecuteCommand + 0 + 0 + + b5f2343f-51bc-4f7b-a620-4fbe54b68da6 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 889b048f-05e1-4504-916a-d71bf19f42a1 + ConditionStart + 0 + 0 + + -1 + 0 + 0 + 1 + 0 + 12 + 2 + ~~CarNumber + 0 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1011c678-9859-47f3-bf45-fd6a3dfe68e3 + TextSet + 0 + 0 + + ~~SaySomething + Sorry, that car is not in the session + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + f3a368e5-3ea5-4086-ae83-004cb5ea9a9a + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9b812b08-8bab-4fbe-9c8c-d0071c9831bd + ExitCommand + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5cbf13c7-1265-4d27-a582-64762872dea1 + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 8 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c48a95d4-b078-4918-b48c-84d4d488a250 + WriteToLog + 0 + 0 + + Watching Car Number '{TXT:~~CarNumber}' + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 5509ac4e-c7d5-4ede-bd81-7c04ab3c4ea3 + TextSet + 0 + 0 + + ~~SaySomething + Watching car number {TXT:~~CarNumber} + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + af780265-ddef-42e2-80ca-55770b9620f5 + ExecuteCommand + 0 + 0 + + 9fa03112-3129-4061-840c-aa64b35ca83d + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + dfc7bf03-0482-4824-92c8-25eee4696076 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + e86750b4-ec60-490b-940f-c848e10b823c + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + + 3 + 0 + 0 + false + false + 0 + 0 + 0 + false + false + false + ef0a6288-d3a7-45ae-bbdb-918866345847 + 00000000-0000-0000-0000-000000000000 + true + false + false + false + false + 0 + 045e8107-49ff-4129-a2b2-674fcc4b876b + Watch car position + + + false + false + 0 + + 0 + false + false + 0 + 35e4ee0f-5810-484a-9fd7-67aa2cfd428d + Say + 1 + 0 + + Which car position? + 00000000-0000-0000-0000-000000000000 + Default + 100 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9c155477-553d-41b2-a386-3b4b7be019f6 + WaitSpokenPrompt + 0 + 0 + + [1..65] + ~~CarPosition + 0 + 0 + 0 + 0 + 15 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + fd26abdb-8a43-4172-9f96-5005b03a4767 + ConditionStart + 0 + 0 + + + 0 + 0 + 0 + 0 + 6 + 1 + ~~CarPosition + 9 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + c8742b4c-ad90-42e6-8b77-fc98e4d98eec + TextSet + 0 + 0 + + ~~SaySomething + I didnt get that + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 72a6aa36-5b0f-4438-b2d4-1c13124ced1a + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + f1e037d5-75b5-48f0-a9f1-9e367646d647 + ExitCommand + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 9198a55e-2c1c-4e39-bfde-681ebf4063ec + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 8014d9cf-a00b-49c5-b12b-9570794f48a9 + ExecuteCommand + 0 + 0 + + 02724c04-89e0-4c95-b2c7-e91f21944067 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 30ea6384-5e15-4637-9eb9-b2db3841ca61 + ConditionStart + 0 + 0 + + -1 + 0 + 0 + 1 + 0 + 12 + 2 + ~~CarNumber + 0 + 0 + 0 + + 1 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 1dc8f877-ca70-4b9c-be73-4d714267008d + TextSet + 0 + 0 + + ~~SaySomething + Sorry, that car is not in the session + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 91452262-a8f1-4971-b6ff-af4e9b1e4b13 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 7f2f2112-8523-4f0d-aec7-02d1797384ff + ExitCommand + 0 + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 58b65c1f-6a99-4222-b901-e3cbf943ec5e + ConditionEnd + 0 + 0 + + 0 + 0 + 0 + 0 + 8 + 2 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + b8bd3712-933a-4204-a580-2acf3bd08b8c + WriteToLog + 0 + 0 + + Watching Car Number '{TXT:~~CarNumber}' in Position '{TXT:~~CarPosition}' + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + 79f0e60e-7697-4cbe-9ba2-a02f3dcb47ec + TextSet + 0 + 0 + + ~~SaySomething + Watching car number {TXT:~~CarNumber} in position {TXT:~~CarPosition} + + + 0 + 0 + 0 + 0 + + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d401a6f3-b04b-458e-bfd4-022600fcae84 + ExecuteCommand + 0 + 0 + + 9fa03112-3129-4061-840c-aa64b35ca83d + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + + 0 + 0 + + + false + false + 0 + + 0 + false + false + 0 + d3356bcb-fecb-4e06-92a1-ea5d242fd7b8 + ExecuteCommand + 0 + 0 + + 59a2055a-e380-42e0-be68-02186535f3c0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0001-01-01T00:00:00 + 0001-01-01T00:00:00 + false + + 0 + 0 + + + true + true + A4 Focus + false + 0 + 0 + 0 + 0 + 0 + true + true + false + 2 + 0 + 0 + 00000000-0000-0000-0000-000000000000 + false + 0 + false + 0 + 0 + 0 + 0 + false + false + true + iRacing.com Simulator + false + false + false + true + false + false + false + false + false + false + false + false + false + false + false + true + false + 6807ebd7-1c34-4195-878c-76b8976e02b2 + false + false + false + false + false + 0 + 0 + false + false + 0 + false + false + + false + 0 + 0 + 0 + 0 + 0 + 0 + false + 0 + false + false + false + + + false + 0 + false + 0 + 0 + 0 + 0 + 0 + false + false + 0 + false + false + 0 + 0 + 0 + 0 + 0 + false + false + true + Pit Girl + false + 0 + 0 + 0 + 0 + 0 + + 1.10.6 + 10 + 0 + false + 0 + false + + true + 376a90dc-f212-4bdf-ab08-a77385d30b5a + true + true + false + + false + + A3 Cameras + A4 Focus + B1 Debug + C1 iRacing Keypress + + true + 1775fb3d-5210-4538-a627-d9e2cbf4f07e + 0 + 0 + + 0 + 0 + false + + false + + + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + false + + false + false + false + 0 + false + diff --git a/RobertsmaniaReplay/RobertsmaniaPitGirlReplay.vax b/RobertsmaniaReplay/RobertsmaniaPitGirlReplay.vax new file mode 100644 index 0000000..10955a9 Binary files /dev/null and b/RobertsmaniaReplay/RobertsmaniaPitGirlReplay.vax differ diff --git a/RobertsmaniaReplay/RobertsmaniaReplay.csproj b/RobertsmaniaReplay/RobertsmaniaReplay.csproj new file mode 100644 index 0000000..2453b5f --- /dev/null +++ b/RobertsmaniaReplay/RobertsmaniaReplay.csproj @@ -0,0 +1,67 @@ + + + + + Debug + AnyCPU + {C661FC90-C439-46CB-8876-3FFB0B1D0E3A} + Library + Properties + Robertsmania + RobertsmaniaPitGirlReplay + v4.8 + 512 + + + + true + full + false + ..\..\..\..\..\..\Program Files\VoiceAttack\Apps\RobertsmaniaPitGirlReplay\ + DEBUG;TRACE + prompt + 4 + AnyCPU + false + + + pdbonly + true + ..\..\..\..\..\..\Program Files\VoiceAttack\Apps\RobertsmaniaPitGirlReplay\ + TRACE + prompt + 4 + false + + + + + + + + + + + + + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + {72631b85-eb9a-473e-9b4c-65b355a9000d} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/RobertsmaniaReplay/VAPlugin_RobertsmaniaReplay.cs b/RobertsmaniaReplay/VAPlugin_RobertsmaniaReplay.cs new file mode 100644 index 0000000..7c47d58 --- /dev/null +++ b/RobertsmaniaReplay/VAPlugin_RobertsmaniaReplay.cs @@ -0,0 +1,2241 @@ +/* +Copyright (c) 2023 Robertsmania +All rights reserved. +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using iRacingSdkWrapper; +using iRSDKSharp; + +namespace Robertsmania +{ + + public sealed class PitGirlReplay + { + private static dynamic _vaProxy; + private static SdkWrapper _iRSDKWrapper; + + private const float cVersion = 1.001f; + private const int cUpdatesPerSec = 4; + public const int cThrottleMSecs = 1000 / cUpdatesPerSec; + public const int cMaxCars = 64; + private const int cMaxCameras = 25; + private const int cWatchMyCarIdx = -4; + private const int cDontChangeCarIdx = -100; + private const int cWatchMostExcitingCarIdx = -1; + + private const int cSeekWaitTries = 100; + private const int cReplaySearchToleranceFrames = 30; + private const int cMarkerSearchToleranceSecs = 2; + private const int cReplay2LiveToleranceSecs = 4; + + private const int cStartBufferSecs = 2; + private const int cRollingStartBufferMult = 3; + private const int cOvertakeThresholdSecs = 3; + private const int cUndertakeThresholdSecs = 4; + private const int cOvertakeBufferSecs = 5; + private const int cUndertakeBufferSecs = 5; + private const int cIncidentBufferSecs = 5; + private const int cRadioBufferSecs = 2; + private const int cRecapBufferSecs = 4; + private const int cReplayStartSecs = 45; + private const int cReplayStartMaxMarkers = 6; + private const int cTransitionSleepMSecs = 500; + + public const int cIncidentMarkerTimeoutSecs = 5; + public const int cPositionMarkerTimeoutSecs = 1; + public const int cRadioMarkerTimeoutSecs = 5; + public const int cNotInWorldTimeoutSecs = 5; + + public static bool g_Connected = false; + public static bool g_WatchingLive = false; + public static bool g_PracticingSession = false; + public static bool g_QualifyingSession = false; + public static bool g_RacingSession = false; + + private static string g_EventType = ""; + private static int g_SubSessionID = -1; + private static int g_NumCarClasses = 0; + private static int g_StandingStart = 0; + public static bool g_IsInGarage = false; + public static bool g_IsOnTrack = false; + public static bool g_IsOnTrackCar = false; + public static bool g_IsReplayPlaying = false; + private static string g_SessionDisplayName = "not yet in a session"; + + public static iRacingSdkWrapper.Bitfields.SessionFlag g_CurrentSessionFlags; + public static int g_CamCarIdx = -1; + public static int g_PlayerCarIdx = -1; + private static int g_CamGroupNumber; + private static int g_RadioTransmitCarIdx = -1; + private static int g_CurrentSessionNum = -1; + public static int g_CurrentSessionTime = 0; + public static int g_CurrentSessionTimeRemain = 0; + private static int g_ReplayFrameNum = 0; + private static int g_ReplaySessionNum = -1; + public static int g_ReplaySessionTime = 0; + private static int g_ReplayPlaySpeed = 0; + public static int g_PlayerCarDriverIncidentCount = 0; + + private static int g_NumDrivers = 0; + private static int g_FinalLap = -1; + private static bool g_LeaderFinished = false; + + private static MarkerType g_MarkerTypeFilter = MarkerType.Wildcard; + private static int g_MarkerCarIdxFilter = -1; + + public static iRacingSdkWrapper.SessionStates g_SessionState = iRacingSdkWrapper.SessionStates.Invalid; + public static iRacingSdkWrapper.Bitfields.CameraState g_CamCameraState = new iRacingSdkWrapper.Bitfields.CameraState(); + + public static int[] g_CarIdxIncidentMarkerTimes = new int[cMaxCars]; + public static int[] g_CarIdxPositionMarkerTimes = new int[cMaxCars]; + public static int[] g_CarIdxRadioMarkerTimes = new int[cMaxCars]; + public static int[] g_CarIdxNotInWorldTimes = new int[cMaxCars]; + + public static int[] g_CarIdxLap = new int[cMaxCars]; + public static float[] g_CarIdxLapDistPct = new float[cMaxCars]; + public static TrackSurfaces[] g_CarIdxTrackSurface = new TrackSurfaces[cMaxCars]; + public static TrackSurfaces[] g_OldCarIdxTrackSurface = new TrackSurfaces[cMaxCars]; + + public static List g_SessionNames; + public static Event g_RaceStartEvent = new Event(MarkerType.Start, 0, 0, cDontChangeCarIdx, 0); + public static List g_Markers = new List(); + public static List g_TimeFlagStatus = new List(); + public static Dictionary g_Cameras = new Dictionary(); + public static DriverEntry[] g_Drivers = new DriverEntry[cMaxCars]; + public static TrackPosition[] g_TrackPositions; + public static List[] g_CarIdxTimeLapPositions = new List[cMaxCars]; + + public static HashSet g_CarClasses; + + + #region datatypes + public enum MarkerType + { + Manual = 0, + Radio = 1, + Incident = 2, + Overtake = 3, + Undertake = 4, + Start = 5, + Finish = 6, + Wildcard = 7 + } + + public enum EventCompareType + { + Forward = 0, + Reverse = 1 + } + + public struct FlagStatus + { + public int Session { get; } + public int Time { get; } + public iRacingSdkWrapper.Bitfields.SessionFlag Flags; + public FlagStatus(int session, int time, iRacingSdkWrapper.Bitfields.SessionFlag flags) + { + Session = session; + Time = time; + Flags = flags; + } + } + + public struct TimeLapPosition + { + public int Session { get; } + public int Time { get; } + public int Lap { get; } + public int Position { get; } + public int ClassPosition { get; } + public TimeLapPosition(int session = 0, int time = 0, int lap = 0, int position = 0, int classPosition = 0) + { + Session = session; + Time = time; + Lap = lap; + Position = position; + ClassPosition = classPosition; + } + + public static bool Compare(TimeLapPosition tlp1, TimeLapPosition tlp2) + { + if (tlp1.Session == tlp2.Session && tlp1.Time < tlp2.Time) + { + return true; + } + else if (tlp1.Session < tlp2.Session) + { + return true; + } + else + { + return false; + } + } + } + + public struct Event + { + public int Time { get; } + public int Session { get; } + public int CarIdx { get; } + public int Position { get; } + public int ClassPosition { get; } + public int Lap { get; } + public float DistPct { get; } + public MarkerType EventType { get; } + + public Event(MarkerType eventType = MarkerType.Manual, int session = 0, int time = 0, int carIdx = 0, int lap =0, int position = 0, int classPosition = 0, float distPct = 0) + { + Time = time; + Session = session; + CarIdx = carIdx; + Lap = lap; + EventType = eventType; + Position = position; + ClassPosition = classPosition; + DistPct = distPct; + } + + public static bool Compare(Event e1, Event e2, EventCompareType direction) + { + //DEBUG check for why no next marker plays + //_vaProxy.WriteToLog("Event Compare: " + e1.Time + " " + e2.Time); + if (e1.EventType != MarkerType.Wildcard && e1.EventType != e2.EventType) + { + return false; + } + else if (e1.CarIdx != -1 && e1.CarIdx != e2.CarIdx) + { + return false; + } + else if (e1.Session == e2.Session && e1.Time < e2.Time && direction == EventCompareType.Forward) + { + return true; + } + else if (e1.Session == e2.Session && e1.Time > e2.Time && direction == EventCompareType.Reverse) + { + return true; + } + else if (e1.Session < e2.Session && direction == EventCompareType.Forward) + { + return true; + } + else if (e1.Session > e2.Session && direction == EventCompareType.Reverse) + { + return true; + } + else + { + return false; + } + } + + public static bool Match(Event e1, Event e2) + { + if (e1.Session != e2.Session) + { + return false; + } + else if (e1.EventType != MarkerType.Wildcard && e1.EventType != e2.EventType) + { + return false; + } + else if (e1.CarIdx != -1 && e1.CarIdx != e2.CarIdx) + { + return false; + } + else + { + return true; + } + } + + public override string ToString() => $"({Session}:{Time}L:{Lap} C:{CarIdx} P:{Position} CP:{ClassPosition} :{EventType})"; + } + + public struct DriverEntry + { + public int CarIdx { get; } + public int CarNumberRaw { get; } + public string CarNumStr { get; } + public string UserName { get; } + public int IRating { get; } + public string License { get; } + public string CarClassColor { get; } + public string LicColor { get; } + public int CarClassId { get; } + public string CarName { get; } + public int IsSpectator { get; } + + public DriverEntry(int carIdx = 0, int carNumberRaw = 0, string carNumStr = "0", string userName = " ", int iRating = 0, string license = " ", string carClassColor = " ", string licColor = " ", int carClassId = 0, string carName = " ", int isSpectator = 0) + { + CarIdx = carIdx; + CarNumberRaw = carNumberRaw; + CarNumStr = carNumStr; + UserName = userName; + IRating = iRating; + License = license; + CarClassColor = carClassColor; + LicColor = licColor; + CarClassId = carClassId; + CarName = carName; + IsSpectator = isSpectator; + } + + public override string ToString() => $"[{CarIdx.ToString().PadLeft(2)}:{CarNumStr.PadLeft(3)}:{CarClassId.ToString().PadLeft(4)}:{UserName}]"; + //public override string ToString() => $"[{CarIdx}:{CarNumberRaw}:{CarNumStr}:{UserName}:{IRating}:{License}:{CarClassColor}:{LicColor}] "; + } + + public struct TrackPosition + { + public DriverEntry Driver { get; } + public float DistPct { get; set; } + public int Lap { get; set; } + public TrackSurfaces TrackSurface { get; set; } + public int Position { get; set; } + public int PositionUpFrom { get; set; } + public int PositionDownFrom { get; set; } + public int PositionUpTime { get; set; } + public int PositionDownTime { get; set; } + public int FinalPosition { get; set; } + public int ClassPosition { get; set; } + public bool Finished { get; set; } + + public TrackPosition(DriverEntry driverEntry, float distPct = -1, TrackSurfaces trackSurface = TrackSurfaces.NotInWorld, int lap = -1, int position = -1, int positionUpFrom = -1, int positionDownFrom = -1, int positionUpTime = 0, int positionDownTime = 0) + { + Driver = driverEntry; + DistPct = distPct; + Lap = lap; + TrackSurface = trackSurface; + Position = position; + ClassPosition = position; + PositionUpFrom = positionUpFrom; + PositionDownFrom = positionDownFrom; + PositionUpTime = positionUpTime; + PositionDownTime = positionDownTime; + FinalPosition = 999; + Finished = false; + } + + public static bool Compare(TrackPosition tp1, TrackPosition tp2) + { + if (tp1.Lap == tp2.Lap && tp1.DistPct < tp2.DistPct) + { + return true; + } + else if (tp1.Lap < tp2.Lap) + { + return true; + } + else + { + return false; + } + } + + public override string ToString() => $"(P{Position.ToString().PadLeft(2)}:CP{ClassPosition.ToString().PadLeft(2)}/{PositionUpFrom.ToString().PadLeft(2)}/{PositionDownFrom.ToString().PadLeft(2)}:TU{PositionUpTime.ToString().PadLeft(5)}:TD{PositionDownTime.ToString().PadLeft(5)}:{DistPct.ToString("F3").PadLeft(6)}:L{Lap.ToString().PadLeft(2)}:FP{FinalPosition.ToString().PadLeft(3)}:{TrackSurface.ToString().PadLeft(15)}:{Driver})"; + } + #endregion + + private static void OnConnected(object sender, System.EventArgs e) + { + g_Connected = true; + } + + private static void OnDisconnected(object sender, System.EventArgs e) + { + g_Connected = false; + g_SessionDisplayName = "no longer in a session"; + } + + private static void ResetTrackPositionData() + { + g_TrackPositions = null; + g_LeaderFinished = false; + g_FinalLap = -1; + //There is no before + for (int i = 0; i < g_Drivers.Length; i++) + { + if (g_CarIdxTimeLapPositions[i] != null) + { + g_CarIdxTimeLapPositions[i].Clear(); + } + } + } + + private static void OnTelemetryUpdated(object sender, SdkWrapper.TelemetryUpdatedEventArgs e) + { + g_PlayerCarIdx = e.TelemetryInfo.PlayerCarIdx.Value; + g_CamGroupNumber = e.TelemetryInfo.CamGroupNumber.Value; + g_RadioTransmitCarIdx = _iRSDKWrapper.GetTelemetryValue("RadioTransmitCarIdx").Value; + g_CurrentSessionTime = (int)e.TelemetryInfo.SessionTime.Value; + g_CurrentSessionTimeRemain = (int)e.TelemetryInfo.SessionTimeRemain.Value; + g_ReplayFrameNum = e.TelemetryInfo.ReplayFrameNum.Value; + g_ReplaySessionNum = e.TelemetryInfo.ReplaySessionNum.Value; + g_ReplaySessionTime = (int)e.TelemetryInfo.ReplaySessionTime.Value; + g_ReplayPlaySpeed = e.TelemetryInfo.ReplayPlaySpeed.Value; + g_IsInGarage = e.TelemetryInfo.IsInGarage.Value; + g_IsOnTrack = e.TelemetryInfo.IsOnTrack.Value; + g_IsOnTrackCar = _iRSDKWrapper.GetTelemetryValue("IsOnTrackCar").Value; + g_IsReplayPlaying = e.TelemetryInfo.IsReplayPlaying.Value; + g_CamCameraState = e.TelemetryInfo.CamCameraState.Value; + g_CamCarIdx = e.TelemetryInfo.CamCarIdx.Value; + g_PlayerCarDriverIncidentCount = e.TelemetryInfo.PlayerCarDriverIncidentCount.Value; + + //Did the session just transition? + if (g_CurrentSessionNum != e.TelemetryInfo.SessionNum.Value) + { + ResetTrackPositionData(); + } + g_CurrentSessionNum = e.TelemetryInfo.SessionNum.Value; + + //Do this each update just in case, bad to miss a session transition + if (g_SessionNames != null && g_SessionNames.Count > g_CurrentSessionNum && g_SessionNames.Count >= e.TelemetryInfo.SessionNum.Value) + { + string sessionName = g_SessionNames[g_CurrentSessionNum]; + switch (sessionName) + { + case "RACE": + { + g_RacingSession = true; + g_PracticingSession = false; + g_QualifyingSession = false; + g_SessionDisplayName = "racing"; + break; + } + case "PRACTICE": + { + g_PracticingSession = true; + g_QualifyingSession = false; + g_RacingSession = false; + g_SessionDisplayName = "practicing"; + break; + } + case "QUALIFY": + { + g_QualifyingSession = true; + g_PracticingSession = false; + g_RacingSession = false; + g_SessionDisplayName = "qualifying"; + break; + } + case "TESTING": + { + g_RacingSession = false; + g_PracticingSession = false; + g_QualifyingSession = false; + g_SessionDisplayName = "testing"; + break; + } + default: //? + { + g_RacingSession = false; + g_PracticingSession = false; + g_QualifyingSession = false; + g_SessionDisplayName = "waiting"; + break; + } + } + } + else + { + _vaProxy.WriteToLog("g_CurrentSessionNum OUT OF BOUNDS: " + g_CurrentSessionNum, "red"); + if (g_SessionNames != null) { + _vaProxy.WriteToLog("g_SessionNames count: " + g_SessionNames.Count, "red"); + } + } + + //Make an effort to set positions once everyone is in the car before the start + if (g_SessionState == SessionStates.GetInCar && + e.TelemetryInfo.SessionState.Value != SessionStates.GetInCar && + g_TrackPositions != null) + { + ResetTrackPositionData(); + } + g_SessionState = e.TelemetryInfo.SessionState.Value; + + //Monitor telemetry arrays + g_CarIdxLap = e.TelemetryInfo.CarIdxLap.Value; + g_CarIdxLapDistPct = e.TelemetryInfo.CarIdxLapDistPct.Value; + g_CarIdxTrackSurface = e.TelemetryInfo.CarIdxTrackSurface.Value; + + //Is the replay showing live? Need to check the time remaining for the case when we disconnect from server (goes to a large negative value then) + g_WatchingLive = Math.Abs(g_CurrentSessionTime - g_ReplaySessionTime) < cReplay2LiveToleranceSecs && g_CurrentSessionTimeRemain > -1000; + + //Monitor Track Positons, Look for Overtakes/Undertakes + if (g_RacingSession && g_SessionState == SessionStates.Checkered && g_FinalLap == -1) + { + g_FinalLap = g_CarIdxLap.Max(); + } + //Build track position array + if (g_TrackPositions == null) + { + //Only do this if we actually have driver data + if (g_NumDrivers > 0) + { + g_TrackPositions = new TrackPosition[g_NumDrivers]; + for (int carIdx = 0; carIdx < g_NumDrivers; carIdx++) + { + TrackPosition trackPosition = new TrackPosition(g_Drivers[carIdx], g_CarIdxLapDistPct[carIdx], g_CarIdxTrackSurface[carIdx], g_CarIdxLap[carIdx]); + g_TrackPositions[carIdx] = trackPosition; + } + } + } + //Update track position data + else + { + //Sort by CarIdx to update + Array.Sort(g_TrackPositions, (p1, p2) => + { + return p1.Driver.CarIdx.CompareTo(p2.Driver.CarIdx); + }); + + //Set Lap, DistPct, TrackSurface and FinalPosition + for (int carIdx = 0; carIdx < g_TrackPositions.Count(); carIdx++) + { + //Keep the Pace Car out of the way + if (g_TrackPositions[carIdx].Driver.UserName == "Pace Car") + { + g_TrackPositions[carIdx].Lap = -2; + g_TrackPositions[carIdx].DistPct = -1; + continue; + } + //Starting a new lap? Add time lap position data for this car at this time + if (g_TrackPositions[carIdx].Lap > 0 && + g_TrackPositions[carIdx].Lap < g_CarIdxLap[carIdx]) + { + //_iRSDKWrapper.Replay.SetPlaybackSpeed(0); + TimeLapPosition carTimeLapPosition = new TimeLapPosition(g_CurrentSessionNum, g_CurrentSessionTime, g_CarIdxLap[carIdx], g_TrackPositions[carIdx].Position, g_TrackPositions[carIdx].ClassPosition); + g_CarIdxTimeLapPositions[carIdx].Add(carTimeLapPosition); + } + + //Is this the leader finishing? Make really sure. + if (g_RacingSession && + !g_LeaderFinished && + g_FinalLap > 0 && + g_SessionState == SessionStates.Checkered && + new[]{TrackSurfaces.OnTrack, TrackSurfaces.OffTrack}.Contains(g_CarIdxTrackSurface[carIdx]) && + g_CarIdxLap[carIdx] > g_FinalLap) + { + g_LeaderFinished = true; + Event finishEvent = new Event(MarkerType.Finish, g_CurrentSessionNum, g_CurrentSessionTime, carIdx, g_TrackPositions[carIdx].Lap, g_TrackPositions[carIdx].Position, g_TrackPositions[carIdx].ClassPosition, g_TrackPositions[carIdx].DistPct); + AddMarker(finishEvent); + } + //Cars finishing + if (g_LeaderFinished && + new[]{TrackSurfaces.OnTrack, TrackSurfaces.OffTrack}.Contains(g_CarIdxTrackSurface[carIdx]) && + g_TrackPositions[carIdx].Lap < g_CarIdxLap[carIdx]) + { + //TODO check for photo finish? We are really using the postion from the previous update + g_TrackPositions[carIdx].Finished = true; + g_TrackPositions[carIdx].FinalPosition = g_TrackPositions[carIdx].Position; + g_TrackPositions[carIdx].Lap = g_CarIdxLap[carIdx]; + g_TrackPositions[carIdx].TrackSurface = g_CarIdxTrackSurface[carIdx]; + //Force DistPct to reflect their FinalPosition so the order is static + g_TrackPositions[carIdx].DistPct = (float)(100 - g_TrackPositions[carIdx].FinalPosition) / 100; + Event finishEvent = new Event(MarkerType.Finish, g_CurrentSessionNum, g_CurrentSessionTime, carIdx, g_TrackPositions[carIdx].Lap, g_TrackPositions[carIdx].Position, g_TrackPositions[carIdx].ClassPosition, g_TrackPositions[carIdx].DistPct); + AddMarker(finishEvent); + } + + //Otherwise someone who hasnt finished + else if (!g_TrackPositions[carIdx].Finished) + { + g_TrackPositions[carIdx].TrackSurface = g_CarIdxTrackSurface[carIdx]; + //Keep track of cars blinking out of the world + if (g_TrackPositions[carIdx].TrackSurface == TrackSurfaces.NotInWorld) + { + g_CarIdxNotInWorldTimes[carIdx] = g_CurrentSessionTime; + } + //Cars in pits dont count, push to bottom of standings + if (g_TrackPositions[carIdx].TrackSurface == TrackSurfaces.AproachingPits || + g_TrackPositions[carIdx].TrackSurface == TrackSurfaces.InPitStall) + { + //TODO handle multiple people on pit row less arbitrarily + g_TrackPositions[carIdx].DistPct = -1; + g_TrackPositions[carIdx].Lap = g_CarIdxLap[carIdx]; + } + else + { + //Sometimes Lap increases and DistPct is still very high so they appear to leapfrog ahead + if (g_TrackPositions[carIdx].Lap > 0 && + g_TrackPositions[carIdx].Lap < g_CarIdxLap[carIdx] && + g_CarIdxLapDistPct[carIdx] > 0.5) + { + //DEBUG look at the Lap transition DistPct + //_vaProxy.WriteToLog(g_TrackPositions[carIdx].Driver.UserName + " started lap " + g_CarIdxLap[carIdx] + " with DistPct " + g_CarIdxLapDistPct[carIdx]); + //_iRSDKWrapper.Replay.SetPlaybackSpeed(0); + //_iRSDKWrapper.Camera.SwitchToCar(g_TrackPositions[carIdx].Driver.CarNumberRaw); + g_TrackPositions[carIdx].DistPct = 0; + //_iRSDKWrapper.Replay.SetPlaybackSpeed(1); + } + else + { + g_TrackPositions[carIdx].DistPct = g_CarIdxLapDistPct[carIdx]; + } + + //Hack for race start when everyone is on Lap 1 in g_CarIdxLap but before the start/finish + if (new[]{SessionStates.Racing, SessionStates.Checkered}.Contains(g_SessionState) && + (g_CarIdxLap[carIdx] > 1 || g_TrackPositions[carIdx].DistPct < 0.25)) + { + g_TrackPositions[carIdx].Lap = g_CarIdxLap[carIdx]; + } + } + } + } + + //Computers are fast + Array.Sort(g_TrackPositions, (p1, p2) => + { + //Lap first then distance + int ret = p2.Lap.CompareTo(p1.Lap); + return ret != 0 ? ret : p2.DistPct.CompareTo(p1.DistPct); + }); + + //Do initialization and undertakes first so we can validate overtakes + for (int p = 0; p < g_TrackPositions.Count(); p++) + { + //Dont change cars that have finished + if (g_TrackPositions[p].Finished) + { + continue; + } + else if (g_TrackPositions[p].Position == -1) //New here? + { + g_TrackPositions[p].Position = p + 1; + g_TrackPositions[p].PositionUpFrom = -1; + g_TrackPositions[p].PositionDownFrom = -1; + g_TrackPositions[p].PositionUpTime = 0; + g_TrackPositions[p].PositionDownTime = 0; + } + else if (g_TrackPositions[p].DistPct >= 0 && + new[]{TrackSurfaces.OnTrack, TrackSurfaces.OffTrack}.Contains(g_TrackPositions[p].TrackSurface) && + g_TrackPositions[p].Position < p + 1) //undertake + { + //Already in an undertake? Only set old position if not + if (g_TrackPositions[p].PositionDownTime == 0) + { + //DEBUG watch the overtaken + //_iRSDKWrapper.Replay.SetPlaybackSpeed(0); + //_iRSDKWrapper.Camera.SwitchToCar(g_TrackPositions[p].Driver.CarNumberRaw); + //_vaProxy.WriteToLog("Undertake Detected"); + + //Set time in second pass below if verified + //g_TrackPositions[p].PositionDownTime = g_CurrentSessionTime; + g_TrackPositions[p].PositionDownFrom = g_TrackPositions[p].Position; + + //_iRSDKWrapper.Replay.SetPlaybackSpeed(1); + } + g_TrackPositions[p].Position = p + 1; + } + } + //Now look for overtakes + for (int p = 0; p < g_TrackPositions.Count(); p++) + { + //Dont change cars that have finished + if (g_TrackPositions[p].Finished) + { + continue; + } + else if (g_TrackPositions[p].DistPct >= 0 && + new[]{TrackSurfaces.OnTrack, TrackSurfaces.OffTrack}.Contains(g_TrackPositions[p].TrackSurface) && + g_TrackPositions[p].Position > p + 1) //overtake + { + //Already in an overtake? Only set timer and old position if not + if (g_TrackPositions[p].PositionUpTime == 0) + { + //Check for an undertake PositionDownFrom that matches the overtake position + //If there is one, then consider it valid - othewhise pit/tow/disconnect/freebie + TrackPosition[] lostPositions = Array.FindAll(g_TrackPositions, t => t.PositionDownFrom == p + 1); + if (lostPositions.Any()) + //TODO this array/find feels like a total hack to get around OffTrack being the default for a new struct + { + TrackPosition lostPosition = lostPositions.First(); + if (new[] { TrackSurfaces.OnTrack, TrackSurfaces.OffTrack }.Contains(lostPosition.TrackSurface)) + { + //DEBUG watch the overtake + //_iRSDKWrapper.Replay.SetPlaybackSpeed(0); + //_iRSDKWrapper.Camera.SwitchToCar(g_TrackPositions[p].Driver.CarNumberRaw); + //_vaProxy.WriteToLog("Overtake Detected"); + g_TrackPositions[p].PositionUpTime = g_CurrentSessionTime; + g_TrackPositions[p].PositionUpFrom = g_TrackPositions[p].Position; + //_iRSDKWrapper.Replay.SetPlaybackSpeed(1); + } + } + else + { + //_vaProxy.WriteToLog("Overtake Cancelled - phantom/freebie? " + g_TrackPositions[p]); + } + } + g_TrackPositions[p].Position = p + 1; + } + } + //Second pass to verify undertakes + for (int p = 0; p < g_TrackPositions.Count(); p++) + { + //Dont change cars that have finished + if (g_TrackPositions[p].Finished) + { + continue; + } + //Check underpasses set in first pass + else if (g_TrackPositions[p].PositionDownFrom != -1 && + g_TrackPositions[p].PositionDownTime == 0) + { + //Check for an overtake PositionUpFrom that matches the undertake position + //If there is one, then consider it valid - othewhise pit/tow/disconnect/freebie + TrackPosition[] gainedPositions = Array.FindAll(g_TrackPositions, t => t.PositionUpFrom == p + 1); + if (gainedPositions.Any()) + //TODO this array/find feels like a total hack to get around OffTrack being the default for a new struct + { + TrackPosition gainedPosition = gainedPositions.First(); + if (new[] { TrackSurfaces.OnTrack, TrackSurfaces.OffTrack }.Contains(gainedPosition.TrackSurface)) + { + g_TrackPositions[p].PositionDownTime = g_CurrentSessionTime; + //g_TrackPositions[p].PositionDownFrom = g_TrackPositions[p].Position; + } + } + else + { + //_vaProxy.WriteToLog("Undertake Cancelled - phantom/freebie? " + g_TrackPositions[p]); + g_TrackPositions[p].PositionDownFrom = -1; + } + } + else + { + //Update position of everyone not involved in a pass + g_TrackPositions[p].Position = p + 1; + } + } + + //Look for Markers to set + for (int p = 0; p < g_TrackPositions.Count(); p++) + { + //Keeping an overtake position? + //Enough time passed since the overtake was noticed? + if (g_TrackPositions[p].PositionUpTime > 0 && + g_CurrentSessionTime-g_TrackPositions[p].PositionUpTime > cOvertakeThresholdSecs) + { + //Kept or increased position + if (g_TrackPositions[p].Position < g_TrackPositions[p].PositionUpFrom) + { + //In the race, past the start, not too soon since last marker for this car? + if (new[]{SessionStates.Racing, SessionStates.Checkered}.Contains(g_SessionState) && + g_RacingSession && + g_TrackPositions[p].Lap > 0 && + PositionMarkerTimeOk(g_TrackPositions[p].Driver.CarIdx) && + g_TrackPositions[p].DistPct >= 0) + { + //DEBUG watch the overtake + //_iRSDKWrapper.Replay.SetPlaybackSpeed(0); + //_iRSDKWrapper.Camera.SwitchToCar(g_TrackPositions[p].Driver.CarNumberRaw); + //_vaProxy.WriteToLog("Overtake Detected"); + Event overtakeEvent = new Event(MarkerType.Overtake, g_CurrentSessionNum, g_TrackPositions[p].PositionUpTime - cOvertakeBufferSecs, g_TrackPositions[p].Driver.CarIdx, g_TrackPositions[p].Lap, g_TrackPositions[p].Position, g_TrackPositions[p].ClassPosition, g_TrackPositions[p].DistPct); + AddMarker(overtakeEvent); + //_vaProxy.WriteToLog("Overtake detected. Position: " + g_TrackPositions[p].Position + " CarIdx: " + g_TrackPositions[p].Driver.CarIdx + " Marker: " + overtakeEvent); + g_CarIdxPositionMarkerTimes[g_TrackPositions[p].Driver.CarIdx] = g_CurrentSessionTime; + //_iRSDKWrapper.Replay.SetPlaybackSpeed(1); + } + } + //Reset in any case + g_TrackPositions[p].PositionUpTime = 0; + g_TrackPositions[p].PositionUpFrom = -1; + } + else if (g_TrackPositions[p].PositionUpTime > g_CurrentSessionTime) + { + //Shouldnt happen live, but can if we are testing in replay + g_TrackPositions[p].PositionUpTime = 0; + } + + //Keeping an undertake position? + //Enough time passed since the undertake was noticed? + if (g_TrackPositions[p].PositionDownTime > 0 && + g_CurrentSessionTime-g_TrackPositions[p].PositionDownTime > cUndertakeThresholdSecs) + { + //Lost or decreased position + if (g_TrackPositions[p].Position > g_TrackPositions[p].PositionDownFrom) + { + //In the race, past the start, not too soon since last marker for this car? + if (new[]{SessionStates.Racing, SessionStates.Checkered}.Contains(g_SessionState) && + g_RacingSession && + g_TrackPositions[p].Lap > 0 && + PositionMarkerTimeOk(g_TrackPositions[p].Driver.CarIdx) && + g_TrackPositions[p].DistPct >= 0) + { + Event undertakeEvent = new Event(MarkerType.Undertake, g_CurrentSessionNum, g_TrackPositions[p].PositionDownTime - cUndertakeBufferSecs, g_TrackPositions[p].Driver.CarIdx, g_TrackPositions[p].Lap, g_TrackPositions[p].Position, g_TrackPositions[p].ClassPosition, g_TrackPositions[p].DistPct); + AddMarker(undertakeEvent); + //_vaProxy.WriteToLog("Undertake detected. Position: " + g_TrackPositions[p].Position + " CarIdx: " + g_TrackPositions[p].Driver.CarIdx + " Marker: " + undertakeEvent); + g_CarIdxPositionMarkerTimes[g_TrackPositions[p].Driver.CarIdx] = g_CurrentSessionTime; + //DEBUG watch the overtaken + //_iRSDKWrapper.Replay.SetPlaybackSpeed(0); + //_iRSDKWrapper.Camera.SwitchToCar(g_TrackPositions[p].Driver.CarNumberRaw); + //_vaProxy.WriteToLog("Undertake Completed"); + //_iRSDKWrapper.Replay.SetPlaybackSpeed(1); + } + } + //Reset in any case + g_TrackPositions[p].PositionDownTime = 0; + g_TrackPositions[p].PositionDownFrom = -1; + } + else if (g_TrackPositions[p].PositionDownTime > g_CurrentSessionTime) + { + //Shouldnt happen live, but can if we are testing in replay + g_TrackPositions[p].PositionDownTime = 0; + } + } + + //Set ClassPositions + Array.Sort(g_TrackPositions, (p1, p2) => + { + //Lap CarClassId then Position + int ret = p1.Driver.CarClassId.CompareTo(p2.Driver.CarClassId); + return ret != 0 ? ret : p1.Position.CompareTo(p2.Position); + }); + //Iterate through g_ClassPositions and set in sequence + foreach (var carClass in g_CarClasses) + { + int cp = 1; + for (int i = 0; i < g_TrackPositions.Length; i++) + { + if (g_TrackPositions[i].Driver.CarClassId == carClass) + { + //Set a TimeLapPosition if class position changed + if (g_TrackPositions[i].ClassPosition != cp) + { + TimeLapPosition carTimeLapPosition = new TimeLapPosition(g_CurrentSessionNum, g_CurrentSessionTime, g_TrackPositions[i].Lap, g_TrackPositions[i].Position, cp); + g_CarIdxTimeLapPositions[g_TrackPositions[i].Driver.CarIdx].Add(carTimeLapPosition); + } + g_TrackPositions[i].ClassPosition = cp++; + } + } + } + + //Just for display at this point + Array.Sort(g_TrackPositions, (p1, p2) => + { + //Lap first then distance + int ret = p2.Lap.CompareTo(p1.Lap); + return ret != 0 ? ret : p2.DistPct.CompareTo(p1.DistPct); + }); + + } + + //Did the flags just change? + if (g_CurrentSessionFlags == null || g_CurrentSessionFlags.ToString() != e.TelemetryInfo.SessionFlags.Value.ToString()) + { + FlagStatus currentFlagStatus = new FlagStatus(g_CurrentSessionNum, g_CurrentSessionTime, e.TelemetryInfo.SessionFlags.Value); + g_TimeFlagStatus.Add(currentFlagStatus); + } + g_CurrentSessionFlags = e.TelemetryInfo.SessionFlags.Value; + + //Look for Race Start - Standing on StartReady, Rolling on StartGo + if (g_RaceStartEvent.Time == 0 && + (g_StandingStart == 1 && g_CurrentSessionFlags.Contains(iRacingSdkWrapper.Bitfields.SessionFlags.StartReady) || + g_StandingStart == 0 && g_CurrentSessionFlags.Contains(iRacingSdkWrapper.Bitfields.SessionFlags.StartGo))) + { + g_RaceStartEvent = new Event(MarkerType.Start, g_CurrentSessionNum, g_CurrentSessionTime, cDontChangeCarIdx, 1); + AddMarker(g_RaceStartEvent); + //_vaProxy.WriteToLog("Race Start Detected: " + g_RaceStartEvent); + } + + //Look for Radio Chatter + //We'll still see radio broadcast events watching in the past, so only record them when watching live + if (g_WatchingLive && g_RadioTransmitCarIdx > -1 && g_RadioTransmitCarIdx < cMaxCars && RadioMarkerTimeOk(g_RadioTransmitCarIdx)) + { + int position = 0; + int classPosition = 0; + float distPct = 0; + if (g_TrackPositions != null) + { + position = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_RadioTransmitCarIdx).Position; + classPosition = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_RadioTransmitCarIdx).ClassPosition; + distPct = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_RadioTransmitCarIdx).DistPct; + } + Event radioEvent = new Event(MarkerType.Radio, g_CurrentSessionNum, g_CurrentSessionTime - cRadioBufferSecs, g_RadioTransmitCarIdx, g_CarIdxLap[g_RadioTransmitCarIdx], position, classPosition, distPct); + AddMarker(radioEvent); + //_vaProxy.WriteToLog("Radio Chatter Detected: " + radioEvent); + g_CarIdxRadioMarkerTimes[g_RadioTransmitCarIdx] = g_CurrentSessionTime; + } + + //Look for Off-Track Incidents + if (g_RacingSession || g_PracticingSession) + { + for (int carIdx = 0; carIdx < g_CarIdxTrackSurface.Count(); carIdx++) + { + if (g_CarIdxTrackSurface[carIdx] == TrackSurfaces.OffTrack && g_OldCarIdxTrackSurface[carIdx] == TrackSurfaces.OnTrack) + { + if (IncidentMarkerTimeOk(carIdx)) + { + int position = 0; + int classPosition = 0; + float distPct = 0; + if (g_TrackPositions != null) + { + position = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_RadioTransmitCarIdx).Position; + classPosition = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_RadioTransmitCarIdx).ClassPosition; + distPct = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_RadioTransmitCarIdx).DistPct; + } + Event incidentEvent = new Event(MarkerType.Incident, g_CurrentSessionNum, g_CurrentSessionTime - cIncidentBufferSecs, carIdx, g_CarIdxLap[carIdx], position, classPosition, distPct); + AddMarker(incidentEvent); + //_vaProxy.WriteToLog("OffTrack Incident Detected: " + incidentEvent); + g_CarIdxIncidentMarkerTimes[carIdx] = g_CurrentSessionTime; + + } + } + } + g_OldCarIdxTrackSurface = g_CarIdxTrackSurface; + } + } + + private static void OnSessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + //_vaProxy.WriteToLog("Session Info Updated"); + if (e.SessionInfo["WeekendInfo"]["EventType"].TryGetValue(out string eventTypeStr)) + { + g_EventType = eventTypeStr; + } + + //Always reset driver table when session info changes, people may have joined + //TODO find how many Drivers in the YAML list so we dont trigger silent exceptions going off the end + //TODO at least check to see if there is a DriverInfo section? + g_CarClasses = new HashSet(); + g_NumDrivers = 0; + for (int i = 0; i < cMaxCars; i++) + { + int carIdx = -1; + int carNumberRaw = -1; + string carNumStr = "-1"; + string userName = " "; + int iRating = -1; + string license = " "; + string carClassColor = " "; + string licColor = " "; + int carClassId = -1; + string carName = " "; + int isSpectator = 0; + + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["CarIdx"].TryGetValue(out string carIdxStr)) + { + if (carIdxStr != "") + { + carIdx = Convert.ToInt32(carIdxStr); + } + } + //There can be weird entries in practice sessions, + //spectator is at the end in races, + //keep going for the whole table but stop counting for races + if (carIdx == -1 && g_EventType == "Race") + { + continue; + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["CarNumberRaw"].TryGetValue(out string carNumberRawStr)) + { + if (carNumberRawStr != "") + { + carNumberRaw = Convert.ToInt32(carNumberRawStr); + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["CarNumber"].TryGetValue(out string carNumberStr)) + { + if (carNumberStr != "") + { + carNumStr = carNumberStr; + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["UserName"].TryGetValue(out string userNameStr)) + { + if (userNameStr != "") + { + userName = userNameStr; + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["IRating"].TryGetValue(out string iRatingStr)) + { + if (iRatingStr != "") + { + iRating = Convert.ToInt32(iRatingStr); + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["LicString"].TryGetValue(out string licenseStr)) + { + if (licenseStr != "") + { + license = licenseStr; + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["CarClassColor"].TryGetValue(out string carClassColorStr)) + { + if (carClassColorStr != "") + { + carClassColor = "#" + Convert.ToInt32(carClassColorStr,16).ToString("X6"); + //int carClassColorInt= Convert.ToInt32(carClassColorStr,16); + //CarClassColor = carClassColorInt.ToString("X6"); + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["LicColor"].TryGetValue(out string licColorStr)) + { + if (licColorStr != "") + { + licColor = "#" + Convert.ToInt32(licColorStr, 16).ToString("X6"); + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["CarClassID"].TryGetValue(out string carClassIdStr)) + { + if (carClassIdStr != "") + { + carClassId = Convert.ToInt32(carClassIdStr); + g_CarClasses.Add(carClassId); + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["CarScreenName"].TryGetValue(out string carNameStr)) + { + if (carNameStr != "") + { + carName = carNameStr; + } + } + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", i]["IsSpectator"].TryGetValue(out string isSpectatorStr)) + { + if (isSpectatorStr != "") + { + isSpectator = Convert.ToInt32(isSpectatorStr); + } + } + g_Drivers[g_NumDrivers] = new DriverEntry(carIdx, carNumberRaw, carNumStr, userName, iRating, license, carClassColor, licColor, carClassId, carName, isSpectator); + g_NumDrivers++; + } + + int subSessionID = 0; + if (e.SessionInfo["WeekendInfo"]["SubSessionID"].TryGetValue(out string subSessionIDStr)) + { + if (subSessionIDStr != null) + { + subSessionID = Convert.ToInt32(subSessionIDStr); + } + } + + if (subSessionID != g_SubSessionID) + { + //New Session - reset everything + PrintInfo(); + _vaProxy.WriteToLog("New Session"); + g_SubSessionID = subSessionID; + g_MarkerTypeFilter = MarkerType.Wildcard; + _vaProxy.SetText("MarkerTypeFilter","Wildcard"); + g_MarkerCarIdxFilter = -1; + _vaProxy.SetText("MarkerCarFilter","-1"); + g_TrackPositions = null; + g_CarIdxIncidentMarkerTimes = new int[cMaxCars]; + g_CarIdxPositionMarkerTimes = new int[cMaxCars]; + g_CarIdxRadioMarkerTimes = new int[cMaxCars]; + g_CarIdxNotInWorldTimes = new int[cMaxCars]; + g_Markers.Clear(); + g_TimeFlagStatus.Clear(); + g_RaceStartEvent = new Event(MarkerType.Start, 0, 0, cDontChangeCarIdx, 0); + g_StandingStart = 0; + g_FinalLap = -1; + g_LeaderFinished = false; + g_PlayerCarDriverIncidentCount = 0; + g_CarIdxTimeLapPositions = new List[cMaxCars]; + for (int i = 0; i < cMaxCars; i++) + { + g_CarIdxTimeLapPositions[i] = new List(); + } + + g_SessionNames = new List(); + int s = 0; + while (e.SessionInfo["SessionInfo"]["Sessions"]["SessionNum", s]["SessionName"].TryGetValue(out string sessionNameStr)) + { + g_SessionNames.Add(sessionNameStr); + s++; + } + + if (e.SessionInfo["WeekendInfo"]["NumCarClasses"].TryGetValue(out string numCarClassesStr)) + { + if (numCarClassesStr != null) + { + g_NumCarClasses = Convert.ToInt32(numCarClassesStr); + } + } + + if (e.SessionInfo["WeekendInfo"]["WeekendOptions"]["StandingStart"].TryGetValue(out string standingStartStr)) + { + if (standingStartStr != null) + { + g_StandingStart = Convert.ToInt32(standingStartStr); + } + } + + //Cameras change track to track but should be the same for the session + g_Cameras.Clear(); + + int c = 1; + while (e.SessionInfo["CameraInfo"]["Groups"]["GroupNum", c]["GroupName"].TryGetValue(out string cameraGroupNameStr)) + { + if (cameraGroupNameStr != null) + { + //Avoid case issues with camera names + cameraGroupNameStr = cameraGroupNameStr.ToUpper(); + if (!g_Cameras.ContainsKey(cameraGroupNameStr)) + { + g_Cameras.Add(cameraGroupNameStr, c); + } + } + c++; + } + + //Seems clumsy, but handle tracks that dont have "TV Static" and/or "TV Mixed" + if (!g_Cameras.ContainsKey("TV STATIC")) + { + if (g_Cameras.TryGetValue("TV3", out int iTV3)) + { + g_Cameras.Add("TV STATIC", iTV3); + } + } + if (!g_Cameras.ContainsKey("TV MIXED")) + { + if (g_Cameras.TryGetValue("TV3", out int iTV3)) + { + g_Cameras.Add("TV MIXED", iTV3); + } + } + + if (g_Cameras.Count == 0) + { + _vaProxy.WriteToLog("NO CAMERAS in session update!", "red"); + } + } + } + + public static bool IncidentMarkerTimeOk(int carIdx) + { + if (carIdx < 0) + { + return false; + } + return ((g_CurrentSessionTime - g_CarIdxIncidentMarkerTimes[carIdx]) > cIncidentMarkerTimeoutSecs); + } + + public static bool PositionMarkerTimeOk(int carIdx) + { + if (carIdx < 0) + { + return false; + } + //If they have just been blinking/NotInWorld, dont set position change markers + if ((g_CurrentSessionTime - g_CarIdxNotInWorldTimes[carIdx]) < cNotInWorldTimeoutSecs) + { + return false; + } + return ((g_CurrentSessionTime - g_CarIdxPositionMarkerTimes[carIdx]) > cPositionMarkerTimeoutSecs); + } + + public static bool RadioMarkerTimeOk(int carIdx) + { + if (carIdx < 0) + { + return false; + } + return ((g_CurrentSessionTime - g_CarIdxRadioMarkerTimes[carIdx]) > cRadioMarkerTimeoutSecs); + } + + private static void SeekWait() + { + //While seeking the replay frame num stays mostly the same until completed, then it jumps + int tries = cSeekWaitTries; + bool searching = true; + + if (g_Connected) + { + int oldReplayFrameNum = g_ReplayFrameNum; + while (searching && tries > 0) + { + int newReplayFrameNum = g_ReplayFrameNum; + if (Math.Abs(newReplayFrameNum - oldReplayFrameNum) > cReplaySearchToleranceFrames) + { + searching = false; + } + else + { + tries--; + Thread.Sleep(2 * cThrottleMSecs); //kind of arbitrary, but wait 2 data update cycle times + } + } + } + Thread.Sleep(cThrottleMSecs); //Just a little extra to be sure we dont step on something... + } + + private static void PrintInfo() + { + string infoStr = g_SubSessionID + " S:" + g_ReplaySessionNum + " T:" + g_ReplaySessionTime + " F:" + g_ReplayFrameNum + " " + g_CurrentSessionFlags + " "; + infoStr += (g_WatchingLive) ? "LIVE" : "Replaying"; + string markersStr = "Markers:" + g_Markers.Count + "\n"; + string flagsStr = "Flags:" + g_TimeFlagStatus.Count + "\n"; + int i = 0; + foreach (Event Event in g_Markers) + { + markersStr += Event + " "; + i++; + if (i % 5 == 0) markersStr += "\n"; + if (i > 20) + { + markersStr += Event + " [too many more to show]"; + break; + } + } + _vaProxy.WriteToLog(markersStr); + _vaProxy.WriteToLog("Race Start Event: " + g_RaceStartEvent); + _vaProxy.WriteToLog(flagsStr); + _vaProxy.WriteToLog(infoStr); + } + + private static void PrintCameras() + { + string cameraStr = ""; + int count = 1; + foreach (KeyValuePair camera in g_Cameras) + { + cameraStr += "[" + (camera.Value.ToString() + ":" + camera.Key + "] "); + if (count % 9 == 0) cameraStr += "\n"; + count++; + } + _vaProxy.WriteToLog(cameraStr); + _vaProxy.WriteToLog("Print cameras: " + g_Cameras.Count(), "purple"); + } + + private static void PrintDrivers() + { + string driverStr = ""; + for (int i = 0; i 0 && i % 10 == 0) driverStr += "\n"; + } + _vaProxy.WriteToLog(driverStr); + _vaProxy.WriteToLog("Print drivers: " + g_Drivers.Count(), "purple"); + } + + private static string DriverNames() + { + string driverNames = ""; + if (g_Connected) + { + for (int i = 0; i < g_Drivers.Count(); i++) + { + if (g_Drivers[i].UserName != "Pace Car") + { + driverNames += " " + g_Drivers[i].UserName; + } + } + } + return driverNames; + } + + private static void AddMarker(Event newEvent) + { + if (!g_Markers.Contains(newEvent)) + { + g_Markers.Add(newEvent); + //_vaProxy.WriteToLog("Marker added: " + g_Markers.Count()); + } + //computers are fast + g_Markers.Sort((e1, e2) => + { + //session first then time + int ret = e1.Session.CompareTo(e2.Session); + return ret != 0 ? ret : e1.Time.CompareTo(e2.Time); + }); + + //DEBUG - Change camera to the new marker CarIdx + //if (g_WatchingLive && newEvent.CarIdx > -1) + //{ + //_vaProxy.SetText("~~CarNumber",g_Drivers[newEvent.CarIdx].CarNumStr); + //_vaProxy.Command.Execute("A0 ir2pitgirl - Watch Car Number"); + //} + } + + private static void PlayEvent(Event stEvent, int bufferSecs = 0) + { + //Switch the camera to the car, if we have one + if (stEvent.CarIdx >= 0) + { //CarIdx:0 is the pace car in races, but a driver entry in practices + _iRSDKWrapper.Camera.SwitchToCar(g_Drivers[stEvent.CarIdx].CarNumberRaw); + } + + //Search to the replay time in the marker with optional bufferSecs + _iRSDKWrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySearchSessionTime, stEvent.Session, (stEvent.Time - bufferSecs) * 1000); + + //Was having hickups on some transitions that seemed like timing issues, now always seek wait + SeekWait(); + + //Always come out of this playing + if (g_ReplayPlaySpeed != 1) + { + _iRSDKWrapper.Replay.SetPlaybackSpeed(1); + } + } + private static int CheckCarNumber(string checkCarNumberStr) + { + if (g_Connected && g_Drivers != null && checkCarNumberStr != null) + { + //Return the CarNumberRaw for the given checkCarNumberStr + return (g_Drivers.FirstOrDefault(driver => driver.CarNumStr == checkCarNumberStr).CarNumberRaw); + } + else + { + return -1; + } + } + + private static int CheckCarPosition(string checkCarPositionStr) + { + if (g_Connected && g_Drivers != null && checkCarPositionStr != null) + { + int checkCarPosition = Convert.ToInt32(checkCarPositionStr); + //Return the CarNumberRaw for the given checkCarPositionStr using track position + //TODO class positions? + return (g_TrackPositions.FirstOrDefault(p => p.Position == checkCarPosition).Driver.CarNumberRaw); + } + else + { + return -1; + } + } + + private static void CheckMarkerCarFilter() + { + string markerCarFilterStr = _vaProxy.GetText("MarkerCarFilter"); + if (markerCarFilterStr != null) + { + int markerCarFilterRaw = CheckCarNumber(markerCarFilterStr); + int markerCarFilterInt = Convert.ToInt32(markerCarFilterStr); + if (markerCarFilterInt == cWatchMyCarIdx) + { + g_MarkerCarIdxFilter = g_PlayerCarIdx; + } + else if (markerCarFilterInt == cDontChangeCarIdx) + { + g_MarkerCarIdxFilter = g_CamCarIdx; + } + else if (markerCarFilterRaw > 0) + { + g_MarkerCarIdxFilter = g_Drivers.FirstOrDefault(driver => driver.CarNumberRaw == markerCarFilterRaw).CarIdx; + //If not found, defualt will be 0 so set to -1 to indicate we couldnt find it + if (g_MarkerCarIdxFilter == 0) + { + g_MarkerCarIdxFilter = -1; + } + } + else + { + g_MarkerCarIdxFilter = -1; + } + } + else + { + g_MarkerCarIdxFilter = -1; + } + } + + private static void CheckMarkerTypeFilter() + { + string markerTypeFilterStr = _vaProxy.GetText("MarkerTypeFilter"); + if (markerTypeFilterStr != null) + { + switch (markerTypeFilterStr) + { + case "Overtake": + g_MarkerTypeFilter = MarkerType.Overtake; + break; + case "Undertake": + g_MarkerTypeFilter = MarkerType.Undertake; + break; + case "Incident": + g_MarkerTypeFilter = MarkerType.Incident; + break; + case "Radio": + g_MarkerTypeFilter = MarkerType.Radio; + break; + case "Manual": + g_MarkerTypeFilter = MarkerType.Manual; + break; + case "Wildcard": + g_MarkerTypeFilter = MarkerType.Wildcard; + break; + default: + g_MarkerTypeFilter = MarkerType.Wildcard; + break; + } + } + else + { + g_MarkerTypeFilter = MarkerType.Wildcard; + } + } + + #region PluginBoilerplate + public static string VA_DisplayName() + { + return "PitGirlReplay_VAPlugin - v" + cVersion.ToString(); + } + + public static string VA_DisplayInfo() + { + return "PitGIrl iRacing Replay VoiceAttack Plugin.\r\n\r\n2023 Robertsmania"; + } + + public static Guid VA_Id() + { + return new Guid("{BEDD99AF-141F-47DC-9C4F-1CFDB6FD6E13}"); + } + + //Should I really be doing something with this in my routines? + //static Boolean _stopVariableToMonitor = false; + + //this function is called from VoiceAttack when the 'stop all commands' button is pressed or a, 'stop all commands' action is called. this will help you know if processing needs to stop if you have long-running code + public static void VA_StopCommand() + { + //_stopVariableToMonitor = true; + } + + public static void VA_Exit1(dynamic vaProxy) + { + //this function gets called when VoiceAttack is closing (normally). You would put your cleanup code in here, but be aware that your code must be robust enough to not absolutely depend on this function being called + //TODO any other objects that need to be removed or stopped? + + if (_iRSDKWrapper != null) + { + _iRSDKWrapper.Stop(); + _iRSDKWrapper = null; + } + } + + public static void VA_Init1(dynamic vaProxy) + { + //this is where you can set up whatever session information that you want. this will only be called once on voiceattack load, and it is called asynchronously. + //the SessionState property is a local copy of the state held on to by VoiceAttack. In this case, the state will be a dictionary with zero items. You can add as many items to hold on to as you want. + //note that in this version, you can get and set the VoiceAttack variables directly. + + _vaProxy = vaProxy; + + if (_iRSDKWrapper == null) + { + _iRSDKWrapper = new SdkWrapper(); + } + _iRSDKWrapper.TelemetryUpdated += OnTelemetryUpdated; + _iRSDKWrapper.SessionInfoUpdated += OnSessionInfoUpdated; + _iRSDKWrapper.Connected += OnConnected; + _iRSDKWrapper.Disconnected += OnDisconnected; + + _iRSDKWrapper.TelemetryUpdateFrequency = cUpdatesPerSec; + _iRSDKWrapper.Start(); + + //seems clumsy but there is no default constror for structs + //TODO any other data structures need intialiaztion? + for (int i = 0; i < g_Drivers.Length; i++) + { + g_Drivers[i] = new DriverEntry(0, 0); + } + } + #endregion + + public static void ShowUsage() + { + string usage = "RobertsmaniaPitGirlReplay commands:\n"; + usage += "Print_Info\n"; + usage += "Print_Cameras\n"; + usage += "Print_Drivers\n"; + usage += "Set_Camera | {TXT:~~NewCamera}\n"; + usage += "Get_Camera | {TXT:~~HoldCamera}!\n"; + usage += "Watch_MyCar\n"; + usage += "Watch_MostExciting\n"; + usage += "Watch_CarNumber | {TXT:~~CarNumber}\n"; + usage += "Watch_CarPosition | {TXT:~~CarPosition}\n"; + usage += "Check_CarNumber | {TXT:~~CarNumber}!\n"; + usage += "Check_CarPosition | {TXT:~~CarPosition} {TXT:~~CarNumber}!\n"; + usage += "Jump_ToLive\n"; + usage += "Jump_ToBeginning\n"; + usage += "Marker_Add\n"; + usage += "PlayMarker_Next | {TXT:MarkerCarFilter} {TXT:MarkerTypeFilter} {INT:~~ReplayBufferSecs}\n"; + usage += " | {TXT:~~MarkerDriver}! {TXT:~~MarkerType}!\n"; + usage += "PlayMarker_Previous | {TXT:MarkerCarFilter} {TXT:MarkerTypeFilter} {INT:~~ReplayBufferSecs}\n"; + usage += " | {TXT:~~MarkerDriver}! {TXT:~~MarkerType}!\n"; + usage += "PlayMarker_Last\n"; + usage += "PlayMarker_First\n"; + usage += "SeekMarker_First\n"; + usage += "iRacingIncident_Next\n"; + usage += "iRacingIncident_Previous\n"; + usage += "Marker_Count | {INT:~~MarkerCount}\n"; + usage += "Marker_Summary | {TXT:~~MarkerSummary}! {TXT:~~MostOvertakesCarNum}!\n"; + usage += " {TXT:~~MostIncidentsCarNum}! {TXT:~~MostBroadcastsCarNum}!\n"; + usage += " {INT:~~IncidentMarkerCount}! {INT:~~OvertakeMarkerCount}!\n"; + usage += " {INT:~~RadioMarkerCount}! {INT:~~ManualMarkerCount}!\n"; + usage += " {INT:~~UndertakeMarkerCount}!\n"; + usage += "Marker_Summary_CarNumber | {TXT:~~CarNumber} {INT:~~CarNumberMarkerCount}!\n"; + usage += " {INT:~~CarNumberIncidentMarkerCount}! {INT:~~CarNumberOvertakeMarkerCount}!\n"; + usage += " {INT:~~CarNumberRadioMarkerCount}! {INT:~~CarNumberManualMarkerCount}!\n"; + usage += " {INT:~~CarNumberUndertakeMarkerCount}!\n"; + _vaProxy.WriteToLog(usage, "pink"); + } + + public static void VA_Invoke1(dynamic vaProxy) + { + #region notes + //vaProxy.Context - a string that can be anything you want it to be. this is passed in from the command action. this was added to allow you to just pass a value into the plugin in a simple fashion (without having to set conditions/text values beforehand). Convert the string to whatever type you need to. + //vaProxy.SessionState - all values from the state maintained by VoiceAttack for this plugin. the state allows you to maintain kind of a, 'session' within VoiceAttack. this value is not persisted to disk and will be erased on restart. other plugins do not have access to this state (private to the plugin) + //the SessionState dictionary is the complete state. you can manipulate it however you want, the whole thing will be copied back and replace what VoiceAttack is holding on to + + //the following get and set the various types of variables in VoiceAttack. note that any of these are nullable (can be null and can be set to null). in previous versions of this interface, these were represented by a series of dictionaries + //vaProxy.SetSmallInt and vaProxy.GetSmallInt - use to access short integer values (used to be called, 'conditions') + //vaProxy.SetText and vaProxy.GetText - access text variable values + //vaProxy.SetInt and vaProxy.GetInt - access integer variable values + //vaProxy.SetDecimal and vaProxy.GetDecimal - access decimal variable values + //vaProxy.SetBoolean and vaProxy.GetBoolean - access boolean variable values + //vaProxy.SetDate and vaProxy.GetDate - access date/time variable values + + //to indicate to VoiceAttack that you would like a variable removed, simply set it to null. all variables set here can be used withing VoiceAttack. + //note that the variables are global (for now) and can be accessed by anyone, so be mindful of that while naming + #endregion + + switch (vaProxy.Context) + { + case "Test_Command": + { + vaProxy.SetText("~~SaySomething", "Pitgirl is also love."); + vaProxy.Command.Execute("A0 - SpeechCoordinator - Wait Say Something", false, true, null, "\"PitGirl is love!\""); + //if (g_Drivers.Any()) + //{ + // UpdateDriverInfoXML(g_CamCarIdx); + //string driverName = quotesStart + g_Drivers[g_CamCarIdx].UserName + quotesEnd; + //vaProxy.Command.Execute("Write File", true, true, null, "\"PitGirl is love!\""); + //} + break; + } + + case "Replay_RaceStart": + { + int raceStartBufferSecs = (g_StandingStart == 0) ? + cStartBufferSecs * cRollingStartBufferMult: + cStartBufferSecs; + + CheckMarkerCarFilter(); + if (g_MarkerCarIdxFilter != -1) + { + _iRSDKWrapper.Camera.SwitchToCar(g_Drivers[g_MarkerCarIdxFilter].CarNumberRaw); + } + //Try to handle the case where we havent seen the race start - PitGirl depends on us to not look clumsy + if (g_RaceStartEvent.Time == 0) + { + //start of current session, then next lap than back a few secs + Event stEvent = new Event(MarkerType.Start, g_CurrentSessionNum, g_ReplaySessionTime, cDontChangeCarIdx, 1); + _iRSDKWrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySearchSessionTime, g_CurrentSessionNum, 0); + SeekWait(); + _iRSDKWrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySearch, (int)ReplaySearchModeTypes.NextLap, 0); + SeekWait(); + _iRSDKWrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySearchSessionTime, g_CurrentSessionNum, (g_ReplaySessionTime - raceStartBufferSecs) * 1000); + //vaProxy.WriteToLog("No race start observed, doing our best to fake it", "pink"); + g_RaceStartEvent = new Event(MarkerType.Start, g_ReplaySessionNum, g_ReplaySessionTime, cDontChangeCarIdx, 1); + AddMarker(g_RaceStartEvent); + } + else + { + PlayEvent(g_RaceStartEvent, raceStartBufferSecs); + //vaProxy.WriteToLog("Play Race Start at: " + g_RaceStartEvent, "purple"); + } + SeekWait(); + + _iRSDKWrapper.Replay.SetPlaybackSpeed(1); + + break; + } + + case "Set_Camera": + { + //Sets the iRacing camera to {TXT:~~NewCamera} if its valid + string newCameraStr = vaProxy.GetText("~~NewCamera"); + if (newCameraStr == null) + { + vaProxy.WriteToLog("Couldnt set camera, no {TXT:~~NewCamera} variable. (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + newCameraStr = newCameraStr.ToUpper(); + if (!g_Cameras.TryGetValue(newCameraStr, out int newCameraGroup)) + { + PrintCameras(); + vaProxy.WriteToLog("Couldnt set camera, no camera group : " + newCameraStr + ". (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + _iRSDKWrapper.Camera.SwitchToCar(cDontChangeCarIdx, newCameraGroup); + //vaProxy.WriteToLog("Camera set to " + newCameraStr + ":" + newCameraGroup, "purple"); + break; + } + + case "Get_Camera": + { + //Gets the current camera group name and writes it to {TXT:~~HoldCamera} + string currentCameraStr = g_Cameras.FirstOrDefault(x => x.Value == g_CamGroupNumber).Key; + if (currentCameraStr == null) + { + //Should really never happen, it would mean we have a runtime camera group number thats not in the session camera list + vaProxy.WriteToLog("Couldnt get camera for CamCameraNumber: " + g_CamGroupNumber + " (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + vaProxy.SetText("~~HoldCamera", currentCameraStr); + //vaProxy.WriteToLog("Current CamCameraNumber: " + g_CamGroupNumber + " : " + currentCameraStr, "purple"); + break; + } + + case "Check_CarNumber": + { + //Checks if the {TXT:~~CarNumber} is in the session, sets to -1 if not found + string checkCarNumberStr = vaProxy.GetText("~~CarNumber"); + if (checkCarNumberStr == null) + { + vaProxy.SetText("~~CarNumber", "-1"); + vaProxy.WriteToLog("Couldnt check car number, no {TXT:~~CarNumber} variable. (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + int checkCarNumberRaw = CheckCarNumber(checkCarNumberStr); + if (checkCarNumberRaw < 1) + { + vaProxy.SetText("~~CarNumber", "-1"); + PrintDrivers(); + vaProxy.WriteToLog("Couldnt find car: " + checkCarNumberStr + ". (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + //vaProxy.WriteToLog("Found car number: " + checkCarNumberRaw, "purple"); + break; + } + + case "Check_CarPosition": + { + //Checks if the {TXT:~~CarPosition} is in the session, + //sets {TXT:~~CarNumber} to that CarNumberStr or -1 if not found + string checkCarPositionStr = vaProxy.GetText("~~CarPosition"); + if (checkCarPositionStr == null) + { + vaProxy.SetText("~~CarPosition", "-1"); + vaProxy.WriteToLog("Couldnt check car number, no {TXT:~~CarPosition} variable. (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + int checkCarNumberRaw = CheckCarPosition(checkCarPositionStr); + if (checkCarNumberRaw < 1) + { + vaProxy.SetText("~~CarNumber", "-1"); + PrintDrivers(); + vaProxy.WriteToLog("Couldnt find car for position: " + checkCarPositionStr + ". (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + string checkCarNumStr = g_Drivers.FirstOrDefault(d => d.CarNumberRaw == checkCarNumberRaw).CarNumStr; + vaProxy.SetText("~~CarNumber", checkCarNumStr.ToString()); + //vaProxy.WriteToLog("Found car number: " + checkCarNumStr + " for position: " + checkCarPositionStr, "purple"); + break; + } + + case "Watch_CarNumber": + { + //Changes the camera focus to {TXT:~~CarNumber} + //TODO consider setting {TXT:~~CarNumber} to -1 if its not in the session? + string watchCarNumberStr = vaProxy.GetText("~~CarNumber"); + if (watchCarNumberStr == null) + { + vaProxy.WriteToLog("Couldnt watch car, no {TXT:~~CarNumber} variable. (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + int watchCarNumberRaw = CheckCarNumber(watchCarNumberStr); + if (watchCarNumberRaw < 0) + { + vaProxy.WriteToLog("Couldnt watch car: " + watchCarNumberStr + ". (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + _iRSDKWrapper.Camera.SwitchToCar(watchCarNumberRaw, 0); + //vaProxy.WriteToLog("Watching car number " + watchCarNumberRaw, "purple"); + break; + } + + case "Watch_CarPosition": + { + //Changes the camera focus to {TXT:~~CarPosition} + string watchCarPositionStr = vaProxy.GetText("~~CarPosition"); + if (watchCarPositionStr == null) + { + vaProxy.WriteToLog("Couldnt watch car, no {TXT:~~CarPosition} variable. (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + int watchCarNumberRaw = CheckCarPosition(watchCarPositionStr); + if (watchCarNumberRaw < 0) + { + vaProxy.WriteToLog("Couldnt watch position: " + watchCarPositionStr + ". (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + _iRSDKWrapper.Camera.SwitchToCar(watchCarNumberRaw, 0); + //vaProxy.WriteToLog("Watching car number " + watchCarNumberRaw, "purple"); + break; + } + + case "Marker_Add": + { + if (g_Connected) + { + Event newEvent; + int position = 0; + int classPosition = 0; + float distPct = 0; + + if (g_TrackPositions != null) + { + position = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_CamCarIdx).Position; + classPosition = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_CamCarIdx).ClassPosition; + distPct = g_TrackPositions.FirstOrDefault(tp => tp.Driver.CarIdx == g_CamCarIdx).DistPct; + } + + if (g_WatchingLive) + { + newEvent = new Event(MarkerType.Manual, g_CurrentSessionNum, g_CurrentSessionTime, g_CamCarIdx, g_CarIdxLap[g_CamCarIdx], position, classPosition, distPct); + } + else + { + newEvent = new Event(MarkerType.Manual, g_ReplaySessionNum, g_ReplaySessionTime, g_CamCarIdx); + } + AddMarker(newEvent); + //vaProxy.WriteToLog("New marker: " + newEvent); + break; + } + else + { + break; + } + } + + case "PlayMarker_Next": + { + if (!g_Markers.Any() || !g_Connected) + { + //vaProxy.WriteToLog("No markers"); + break; + } + + int? bufferSecs = vaProxy.GetInt("~~ReplayBufferSecs"); + if (bufferSecs == null) + { + bufferSecs = 0; + } + + int compareTime = g_ReplaySessionTime + cMarkerSearchToleranceSecs; + int compareSessionNum = g_ReplaySessionNum; + bool played = false; + CheckMarkerTypeFilter(); + CheckMarkerCarFilter(); + Event compareEvent = new Event(g_MarkerTypeFilter, compareSessionNum, compareTime, g_MarkerCarIdxFilter, -1); + for (int i = 0; i < g_Markers.Count; i++) + { + //vaProxy.WriteToLog("Play next marker. FilterType: " + g_MarkerTypeFilter + " FilterCarIdx: " + g_MarkerCarIdxFilter + " Time Now:" + compareEvent + " Considering:" + i + " " + g_Markers[i]); + if (Event.Compare(compareEvent, g_Markers[i], EventCompareType.Forward)) + { + PlayEvent(g_Markers[i], (int)bufferSecs); + played = true; + //vaProxy.WriteToLog("Marker played. " + g_Markers[i]); + vaProxy.SetText("~~MarkerType", g_Markers[i].EventType.ToString()); + if (g_Markers[i].CarIdx >= 0 && g_Drivers != null) + { + vaProxy.SetText("~~MarkerDriver", g_Drivers[g_Markers[i].CarIdx].UserName); + } + break; + } + } + if (!played) + { + vaProxy.WriteToLog("No next marker found. FilterType: " + g_MarkerTypeFilter + " FilterCarIdx: " + g_MarkerCarIdxFilter, "orange"); + } + break; + } + + case "PlayMarker_Previous": + { + if (!g_Markers.Any() || !g_Connected) + { + //vaProxy.WriteToLog("No markers"); + break; + } + + int? bufferSecs = vaProxy.GetInt("~~ReplayBufferSecs"); + if (bufferSecs == null) + { + bufferSecs = 0; + } + + int compareTime = g_ReplaySessionTime - cMarkerSearchToleranceSecs; + int compareSessionNum = g_ReplaySessionNum; + bool played = false; + CheckMarkerTypeFilter(); + CheckMarkerCarFilter(); + Event compareEvent = new Event(g_MarkerTypeFilter, compareSessionNum, compareTime, g_MarkerCarIdxFilter, -1); + for (int i = g_Markers.Count - 1; i >= 0; i--) + { + //vaProxy.WriteToLog("Play previous marker. FilterType: " + g_MarkerTypeFilter + " FilterCarIdx: " + g_MarkerCarIdxFilter + " Time Now:" + compareEvent + " Considering:" + i + " " + g_Markers[i]); + //if (Event.Compare(g_Markers[i], compareEvent)) + if (Event.Compare(compareEvent, g_Markers[i], EventCompareType.Reverse)) + { + PlayEvent(g_Markers[i], (int)bufferSecs); + played = true; + //vaProxy.WriteToLog("Marker played. " + g_Markers[i]); + vaProxy.SetText("~~MarkerType", g_Markers[i].EventType.ToString()); + if (g_Markers[i].CarIdx > 0) + { + vaProxy.SetText("~~MarkerDriver", g_Drivers[g_Markers[i].CarIdx].UserName); + } + break; + } + } + if (!played) + { + vaProxy.WriteToLog("No previous marker found. FilterType: " + g_MarkerTypeFilter + " FilterCarIdx: " + g_MarkerCarIdxFilter, "orange"); + } + break; + } + + case "PlayMarker_Last": + { + if (!g_Markers.Any() || !g_Connected) + { + //vaProxy.WriteToLog("No markers"); + break; + } + + var stEvent = g_Markers.Last(); + PlayEvent(stEvent); + //vaProxy.WriteToLog("Play last marker - " + stEvent); + break; + } + + case "PlayMarker_First": + { + if (!g_Markers.Any() || !g_Connected) + { + //vaProxy.WriteToLog("No markers"); + break; + } + + var stEvent = g_Markers.First(); + PlayEvent(stEvent); + //vaProxy.WriteToLog("Play first marker - " + stEvent); + break; + } + + case "SeekMarker_First": + { + if (!g_Markers.Any() || !g_Connected) + { + //vaProxy.WriteToLog("No markers"); + break; + } + //Start just before the first marker, but use the filters + var stEvent = g_Markers.First(); + int compareTime = stEvent.Time - (cMarkerSearchToleranceSecs * 2); + int compareSessionNum = stEvent.Session; + bool played = false; + CheckMarkerTypeFilter(); + CheckMarkerCarFilter(); + Event compareEvent = new Event(g_MarkerTypeFilter, compareSessionNum, compareTime, g_MarkerCarIdxFilter, -1); + for (int i = 0; i < g_Markers.Count; i++) + { + //vaProxy.WriteToLog("Play next marker. FilterType: " + g_MarkerTypeFilter + " FilterCarIdx: " + g_MarkerCarIdxFilter + " Time Now:" + compareEvent + " Considering:" + i + " " + g_Markers[i]); + if (Event.Compare(compareEvent, g_Markers[i], EventCompareType.Forward)) + { + PlayEvent(g_Markers[i]); + played = true; + //vaProxy.WriteToLog("Marker played. " + g_Markers[i]); + break; + } + } + if (!played) + { + //vaProxy.WriteToLog("No next marker found. FilterType: " + g_MarkerTypeFilter + " FilterCarIdx: " + g_MarkerCarIdxFilter); + } + break; + } + + case "Marker_Count": + { + //Write the number of markers to {INT:~~MarkerCount) + int markerCount = 0; + if (g_Connected) + { + markerCount = g_Markers.Count(); + } + vaProxy.SetInt("~~MarkerCount", markerCount); + //vaProxy.WriteToLog("Marker Count: " + markerCount, "purple"); + break; + } + + case "Marker_Summary": + { + //Write a summary of the current markers to {TXT:~~MarkerSummary} + //Most overtakes in {TXT:~~MostOvertakesCarNum} + //Most incidents in {TXT:~~MostIncidentsCarNum} + //Most broadcasts in {TXT:~~MostBroadcastsCarNum} + //Marker count in {TXT:~~MarkerCount} + string summaryStr = ""; + + if (g_Markers.Any() && g_Connected) + { + int[] overtakes = new int[cMaxCars]; + int[] undertakes = new int[cMaxCars]; + int[] incidents = new int[cMaxCars]; + int[] broadcasts = new int[cMaxCars]; + int[] manuals = new int[cMaxCars]; + int mostOvertakes = -1; + int overtakeCarIdx = -1; + string overtakeCarNumStr = "-1"; + int mostUndertakes = -1; + int undertakeCarIdx = -1; + string undertakeCarNumStr = "-1"; + int mostIncidents = -1; + int incidentCarIdx = -1; + string incidentCarNumStr = "-1"; + int mostBroadcasts = -1; + int broadcastCarIdx = -1; + string broadcastCarNumStr = "-1"; + int mostManuals = -1; + int manualCarIdx = -1; + string manualCarNumStr = "-1"; + int starts = 0; + int sessionMarkers = 0; + + foreach (Event marker in g_Markers) + { + if (marker.Session == g_CurrentSessionNum) + { + switch (marker.EventType) + { + case MarkerType.Overtake: + sessionMarkers++; + overtakes[marker.CarIdx]++; + break; + + case MarkerType.Undertake: + sessionMarkers++; + undertakes[marker.CarIdx]++; + break; + + case MarkerType.Incident: + sessionMarkers++; + incidents[marker.CarIdx]++; + break; + + case MarkerType.Radio: + sessionMarkers++; + broadcasts[marker.CarIdx]++; + break; + + case MarkerType.Manual: + sessionMarkers++; + manuals[marker.CarIdx]++; + break; + + case MarkerType.Start: + sessionMarkers++; + starts++; + break; + } + } + } + + mostOvertakes = overtakes.Max(); + if (mostOvertakes > 0) + { + overtakeCarIdx = overtakes.ToList().IndexOf(mostOvertakes); + overtakeCarNumStr = g_Drivers[overtakeCarIdx].CarNumStr; + vaProxy.SetText("~~MostOvertakesCarNum", overtakeCarNumStr); + vaProxy.SetInt("~~OvertakeMarkerCount", overtakes.Sum()); + } + else + { + vaProxy.SetText("~~MostOvertakesCarNum", "-1"); + vaProxy.SetInt("~~OvertakeMarkerCount", 0); + } + + mostUndertakes = undertakes.Max(); + if (mostUndertakes > 0) + { + undertakeCarIdx = undertakes.ToList().IndexOf(mostUndertakes); + undertakeCarNumStr = g_Drivers[undertakeCarIdx].CarNumStr; + vaProxy.SetText("~~MostUndertakesCarNum", undertakeCarNumStr); + vaProxy.SetInt("~~UndertakeMarkerCount", undertakes.Sum()); + } + else + { + vaProxy.SetText("~~MostOvertakesCarNum", "-1"); + vaProxy.SetInt("~~OvertakeMarkerCount", 0); + } + + mostIncidents = incidents.Max(); + if (mostIncidents > 0) + { + incidentCarIdx = incidents.ToList().IndexOf(mostIncidents); + incidentCarNumStr = g_Drivers[incidentCarIdx].CarNumStr; + vaProxy.SetText("~~MostIncidentsCarNum", incidentCarNumStr); + vaProxy.SetInt("~~IncidentMarkerCount", incidents.Sum()); + } + else + { + vaProxy.SetText("~~MostIncidentsCarNum", "-1"); + vaProxy.SetInt("~~IncidentMarkerCount", 0); + } + + mostBroadcasts = broadcasts.Max(); + if (mostBroadcasts > 0) + { + broadcastCarIdx = broadcasts.ToList().IndexOf(mostBroadcasts); + broadcastCarNumStr = g_Drivers[broadcastCarIdx].CarNumStr; + vaProxy.SetText("~~MostBroadcastsCarNum", broadcastCarNumStr); + vaProxy.SetInt("~~RadioMarkerCount", broadcasts.Sum()); + } + else + { + vaProxy.SetText("~~MostBroadcastsCarNum", "-1"); + vaProxy.SetInt("~~RadioMarkerCount", 0); + } + + mostManuals = manuals.Max(); + if (mostManuals > 0) + { + manualCarIdx = manuals.ToList().IndexOf(mostManuals); + manualCarNumStr = g_Drivers[manualCarIdx].CarNumStr; + vaProxy.SetText("~~MostManualsCarNum", manualCarNumStr); + vaProxy.SetInt("~~ManualMarkerCount", manuals.Sum()); + } + else + { + vaProxy.SetText("~~MostManualsCarNum", "-1"); + vaProxy.SetInt("~~ManualMarkerCount", 0); + } + + vaProxy.SetInt("~~MarkerCount", sessionMarkers); + + summaryStr += $"There are {sessionMarkers} markers in this session.\n"; + if (overtakes.Sum() > 0) + { + summaryStr += overtakes.Sum() + " overtakes, with car " + overtakeCarNumStr + " having the most at " + mostOvertakes + ".\n"; + } + if (undertakes.Sum() > 0) + { + summaryStr += undertakes.Sum() + " undertakes, with car " + undertakeCarNumStr + " having the most at " + mostUndertakes + ".\n"; + } + if (incidents.Sum() > 0) + { + summaryStr += incidents.Sum() + " incidents, with car " + incidentCarNumStr + " having the most at " + mostIncidents + ".\n"; + } + if (broadcasts.Sum() > 0) + { + summaryStr += broadcasts.Sum() + " radio broadcasts, with car " + broadcastCarNumStr + " having the most at " + mostBroadcasts + ".\n"; + } + if (starts > 0) + { + summaryStr += "The race start was also set as a marker."; + } + } + else + { + summaryStr = "There are no markers."; + vaProxy.SetText("~~MostOvertakesCarNum", "-1"); + vaProxy.SetText("~~MostUndertakesCarNum", "-1"); + vaProxy.SetText("~~MostIncidentsCarNum", "-1"); + vaProxy.SetText("~~MostBroadcastsCarNum", "-1"); + vaProxy.SetText("~~MostManualsCarNum", "-1"); + vaProxy.SetInt("~~MarkerCount", 0); + } + + vaProxy.SetText("~~MarkerSummary", summaryStr); + vaProxy.WriteToLog("Marker Summary: " + summaryStr, "purple"); + break; + } + + case "Marker_Summary_CarNumber": + { + string summaryStr = "There are no markers."; + int carNumberMarkerCount = 0; + int carNumberIncidentMarkerCount = 0; + int carNumberOvertakeMarkerCount = 0; + int carNumberUndertakeMarkerCount = 0; + int carNumberRadioMarkerCount = 0; + int carNumberManualMarkerCount = 0; + vaProxy.SetInt("~~CarNumberMarkerCount", carNumberMarkerCount); + vaProxy.SetInt("~~CarNumberIncidentMarkerCount", carNumberIncidentMarkerCount); + vaProxy.SetInt("~~CarNumberOvertakeMarkerCount", carNumberOvertakeMarkerCount); + vaProxy.SetInt("~~CarNumberUndertakeMarkerCount", carNumberUndertakeMarkerCount); + vaProxy.SetInt("~~CarNumberRadioMarkerCount", carNumberRadioMarkerCount); + vaProxy.SetInt("~~CarNumberManualMarkerCount", carNumberManualMarkerCount); + + string carNumberStr = vaProxy.GetText("~~CarNumber"); + if (carNumberStr == null) + { + vaProxy.WriteToLog("Couldnt get marker summary for car number, no {INT:~~CarNumber} variable. (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + int carNumberRaw = CheckCarNumber(carNumberStr); + if (carNumberRaw < 0) + { + vaProxy.SetText("~~CarNumber", "-1"); + PrintDrivers(); + vaProxy.WriteToLog("Couldnt find car: " + carNumberStr + ". (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + + if (g_Markers.Any() && g_Connected && g_Drivers != null) + { + int carNumberIdx = g_Drivers.FirstOrDefault(d => d.CarNumberRaw == carNumberRaw).CarIdx; + foreach (Event marker in g_Markers) + { + if (marker.Session == g_CurrentSessionNum && marker.CarIdx == carNumberIdx) + { + switch (marker.EventType) + { + case MarkerType.Overtake: + carNumberMarkerCount++; + carNumberOvertakeMarkerCount++; + break; + + case MarkerType.Undertake: + carNumberMarkerCount++; + carNumberUndertakeMarkerCount++; + break; + + case MarkerType.Incident: + carNumberMarkerCount++; + carNumberIncidentMarkerCount++; + break; + + case MarkerType.Radio: + carNumberMarkerCount++; + carNumberRadioMarkerCount++; + break; + + case MarkerType.Manual: + carNumberMarkerCount++; + carNumberManualMarkerCount++; + break; + } + + } + } + summaryStr = "There are " + carNumberMarkerCount + " markers for CarNumber " + carNumberStr + ".\n"; + if (carNumberOvertakeMarkerCount > 0) + { + summaryStr += carNumberOvertakeMarkerCount + " overtakes.\n"; + } + if (carNumberUndertakeMarkerCount > 0) + { + summaryStr += carNumberUndertakeMarkerCount + " undertakes.\n"; + } + if (carNumberIncidentMarkerCount > 0) + { + summaryStr += carNumberIncidentMarkerCount + " incidents.\n"; + } + if (carNumberRadioMarkerCount > 0) + { + summaryStr += carNumberRadioMarkerCount + " radio broadcasts.\n"; + } + if (carNumberManualMarkerCount > 0) + { + summaryStr += carNumberManualMarkerCount + " manual markers.\n"; + } + + vaProxy.SetInt("~~CarNumberMarkerCount", carNumberMarkerCount); + vaProxy.SetInt("~~CarNumberIncidentMarkerCount", carNumberIncidentMarkerCount); + vaProxy.SetInt("~~CarNumberOvertakeMarkerCount", carNumberOvertakeMarkerCount); + vaProxy.SetInt("~~CarNumberUndertakeMarkerCount", carNumberUndertakeMarkerCount); + vaProxy.SetInt("~~CarNumberRadioMarkerCount", carNumberRadioMarkerCount); + vaProxy.SetInt("~~CarNumberManualMarkerCount", carNumberManualMarkerCount); + + } + vaProxy.SetText("~~CarNumberMarkerSummary", summaryStr); + //vaProxy.WriteToLog("CarNumberMarker Summary: " + summaryStr, "purple"); + break; + } + + case "Jump_ToLive": + _iRSDKWrapper.Replay.JumpToLive(); + //vaProxy.WriteToLog("Jump to live"); + break; + + case "Jump_ToBeginning": + _iRSDKWrapper.Replay.JumpToStart(); + //vaProxy.WriteToLog("Jump to beginning of recording"); + SeekWait(); + _iRSDKWrapper.Replay.SetPlaybackSpeed(1); + break; + + case "iRacingIncident_Previous": + //iRacing Incident + _iRSDKWrapper.Replay.Jump(ReplaySearchModeTypes.PreviousIncident); + SeekWait(); + _iRSDKWrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySearchSessionTime, (int)g_ReplaySessionNum, (g_ReplaySessionTime - cIncidentBufferSecs) * 1000); + //Always come out of this playing + _iRSDKWrapper.Replay.SetPlaybackSpeed(1); + //vaProxy.WriteToLog("Playing previous iRacing incident"); + break; + + case "iRacingIncident_Next": + //iRacing Incident + _iRSDKWrapper.Replay.Jump(ReplaySearchModeTypes.NextIncident); + SeekWait(); + _iRSDKWrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySearchSessionTime, (int)g_ReplaySessionNum, (g_ReplaySessionTime - cIncidentBufferSecs) * 1000); + //Always come out of this playing + _iRSDKWrapper.Replay.SetPlaybackSpeed(1); + //vaProxy.WriteToLog("Playing previous iRacing incident"); + break; + + case "Watch_MyCar": + if (g_PlayerCarIdx > 0 && g_Drivers.First(d => d.CarIdx == g_PlayerCarIdx).IsSpectator != 1) + { + _iRSDKWrapper.Camera.SwitchToCar(cWatchMyCarIdx, 0); + //vaProxy.WriteToLog("Watching your car", "purple"); + } + else if (g_TrackPositions != null) + { + int leaderCarNumRaw = g_TrackPositions.FirstOrDefault(d => d.Position == 1).Driver.CarNumberRaw; + _iRSDKWrapper.Camera.SwitchToCar(leaderCarNumRaw, 0); + vaProxy.WriteToLog("Watch_MyCar: No Player Car, switching to leader.", "orange"); + } + else if (g_CarIdxTrackSurface[0] != TrackSurfaces.NotInWorld) + { + _iRSDKWrapper.Camera.SwitchToCar(0, 0); + vaProxy.WriteToLog("Watch_MyCar: Player car not in world, no position data, switching to pace car", "red"); + } + else + { + _iRSDKWrapper.Camera.SwitchToCar(1, 0); + vaProxy.WriteToLog("Watch_MyCar: No Player Car, no pace car, no position data, switching to CarIdx 1", "red"); + } + + break; + + case "Watch_MostExciting": + _iRSDKWrapper.Camera.SwitchToCar(cWatchMostExcitingCarIdx, 0); + //vaProxy.WriteToLog("Watching most exciting", "purple"); + break; + + case "Print_Info": + PrintInfo(); + break; + + case "Print_Cameras": + PrintCameras(); + break; + + case "Print_Drivers": + PrintDrivers(); + break; + + default: + ShowUsage(); + vaProxy.WriteToLog("[" + vaProxy.Context + "] is not a recognized PitGirlVAPlugin command. (" + vaProxy.Command.Name() + ") attempted to use it.", "red"); + break; + } + } + } +} diff --git a/iRacingSdkWrapper/LICENSE b/iRacingSdkWrapper/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/iRacingSdkWrapper/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/iRacingSdkWrapper/RM_Readme.txt b/iRacingSdkWrapper/RM_Readme.txt new file mode 100644 index 0000000..9dde034 --- /dev/null +++ b/iRacingSdkWrapper/RM_Readme.txt @@ -0,0 +1,11 @@ +The GitHub respository for this project is here: +https://github.com/NickThissen/iRacingSdkWrapper.git + +In this repostiry, these files have been modified: + +iRacingSdkWrapper.csproj +iRSDKSharp.csproj + v4.7.2 + +iRacingSDK.cs - Added enums for FFBCommand, ReplaySearchSessionTime, VideoCapture + public enum BroadcastMessageTypes { CamSwitchPos = 0, CamSwitchNum, CamSetState, ReplaySetPlaySpeed, ReplaySetPlayPosition, ReplaySearch, ReplaySetState, ReloadTextures, ChatCommand, PitCommand, TelemCommand, FFBCommand, ReplaySearchSessionTime, VideoCapture }; diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/App.config b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/App.config new file mode 100644 index 0000000..9c05822 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.Designer.cs new file mode 100644 index 0000000..6135a18 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.Designer.cs @@ -0,0 +1,272 @@ +namespace iRacingSdkWrapper.Examples.BroadcastMessages +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.numSetPos = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.btnSetPos = new System.Windows.Forms.Button(); + this.btnSetPosEnd = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.numSetPosEnd = new System.Windows.Forms.NumericUpDown(); + this.cboReplayEvents = new System.Windows.Forms.ComboBox(); + this.btnJump = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.btnSetSpeed = new System.Windows.Forms.Button(); + this.label4 = new System.Windows.Forms.Label(); + this.numSpeed = new System.Windows.Forms.NumericUpDown(); + this.chkSlowmo = new System.Windows.Forms.CheckBox(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numSetPos)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numSetPosEnd)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numSpeed)).BeginInit(); + this.SuspendLayout(); + // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl1.Location = new System.Drawing.Point(6, 6); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(760, 389); + this.tabControl1.TabIndex = 0; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.chkSlowmo); + this.tabPage1.Controls.Add(this.btnSetSpeed); + this.tabPage1.Controls.Add(this.label4); + this.tabPage1.Controls.Add(this.numSpeed); + this.tabPage1.Controls.Add(this.label3); + this.tabPage1.Controls.Add(this.btnJump); + this.tabPage1.Controls.Add(this.cboReplayEvents); + this.tabPage1.Controls.Add(this.btnSetPosEnd); + this.tabPage1.Controls.Add(this.label2); + this.tabPage1.Controls.Add(this.numSetPosEnd); + this.tabPage1.Controls.Add(this.btnSetPos); + this.tabPage1.Controls.Add(this.label1); + this.tabPage1.Controls.Add(this.numSetPos); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(752, 363); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "Replay"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // tabPage2 + // + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(905, 441); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "Camera"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // numSetPos + // + this.numSetPos.Location = new System.Drawing.Point(191, 20); + this.numSetPos.Maximum = new decimal(new int[] { + 99999999, + 0, + 0, + 0}); + this.numSetPos.Name = "numSetPos"; + this.numSetPos.Size = new System.Drawing.Size(120, 20); + this.numSetPos.TabIndex = 1; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(19, 22); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(166, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Set position from beginning frame:"; + // + // btnSetPos + // + this.btnSetPos.Location = new System.Drawing.Point(317, 17); + this.btnSetPos.Name = "btnSetPos"; + this.btnSetPos.Size = new System.Drawing.Size(75, 23); + this.btnSetPos.TabIndex = 3; + this.btnSetPos.Text = "Set"; + this.btnSetPos.UseVisualStyleBackColor = true; + this.btnSetPos.Click += new System.EventHandler(this.btnSetPos_Click); + // + // btnSetPosEnd + // + this.btnSetPosEnd.Location = new System.Drawing.Point(317, 46); + this.btnSetPosEnd.Name = "btnSetPosEnd"; + this.btnSetPosEnd.Size = new System.Drawing.Size(75, 23); + this.btnSetPosEnd.TabIndex = 6; + this.btnSetPosEnd.Text = "Set"; + this.btnSetPosEnd.UseVisualStyleBackColor = true; + this.btnSetPosEnd.Click += new System.EventHandler(this.btnSetPosEnd_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(19, 51); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(138, 13); + this.label2.TabIndex = 5; + this.label2.Text = "Set position from end frame:"; + // + // numSetPosEnd + // + this.numSetPosEnd.Location = new System.Drawing.Point(191, 49); + this.numSetPosEnd.Maximum = new decimal(new int[] { + 99999999, + 0, + 0, + 0}); + this.numSetPosEnd.Name = "numSetPosEnd"; + this.numSetPosEnd.Size = new System.Drawing.Size(120, 20); + this.numSetPosEnd.TabIndex = 4; + // + // cboReplayEvents + // + this.cboReplayEvents.FormattingEnabled = true; + this.cboReplayEvents.Location = new System.Drawing.Point(191, 77); + this.cboReplayEvents.Name = "cboReplayEvents"; + this.cboReplayEvents.Size = new System.Drawing.Size(121, 21); + this.cboReplayEvents.TabIndex = 7; + // + // btnJump + // + this.btnJump.Location = new System.Drawing.Point(317, 75); + this.btnJump.Name = "btnJump"; + this.btnJump.Size = new System.Drawing.Size(75, 23); + this.btnJump.TabIndex = 8; + this.btnJump.Text = "Jump"; + this.btnJump.UseVisualStyleBackColor = true; + this.btnJump.Click += new System.EventHandler(this.btnJump_Click); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(19, 80); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(77, 13); + this.label3.TabIndex = 9; + this.label3.Text = "Jump to event:"; + // + // btnSetSpeed + // + this.btnSetSpeed.Location = new System.Drawing.Point(317, 104); + this.btnSetSpeed.Name = "btnSetSpeed"; + this.btnSetSpeed.Size = new System.Drawing.Size(75, 23); + this.btnSetSpeed.TabIndex = 12; + this.btnSetSpeed.Text = "Set"; + this.btnSetSpeed.UseVisualStyleBackColor = true; + this.btnSetSpeed.Click += new System.EventHandler(this.btnSetSpeed_Click); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(19, 109); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(104, 13); + this.label4.TabIndex = 11; + this.label4.Text = "Set playback speed:"; + // + // numSpeed + // + this.numSpeed.Location = new System.Drawing.Point(191, 107); + this.numSpeed.Maximum = new decimal(new int[] { + 99999999, + 0, + 0, + 0}); + this.numSpeed.Minimum = new decimal(new int[] { + 16, + 0, + 0, + -2147483648}); + this.numSpeed.Name = "numSpeed"; + this.numSpeed.Size = new System.Drawing.Size(120, 20); + this.numSpeed.TabIndex = 10; + // + // chkSlowmo + // + this.chkSlowmo.AutoSize = true; + this.chkSlowmo.Location = new System.Drawing.Point(398, 107); + this.chkSlowmo.Name = "chkSlowmo"; + this.chkSlowmo.Size = new System.Drawing.Size(80, 17); + this.chkSlowmo.TabIndex = 13; + this.chkSlowmo.Text = "Slowmotion"; + this.chkSlowmo.UseVisualStyleBackColor = true; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(772, 401); + this.Controls.Add(this.tabControl1); + this.Name = "Form1"; + this.Padding = new System.Windows.Forms.Padding(6); + this.Text = "Form1"; + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numSetPos)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numSetPosEnd)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numSpeed)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.Button btnSetPosEnd; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.NumericUpDown numSetPosEnd; + private System.Windows.Forms.Button btnSetPos; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.NumericUpDown numSetPos; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button btnJump; + private System.Windows.Forms.ComboBox cboReplayEvents; + private System.Windows.Forms.Button btnSetSpeed; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.NumericUpDown numSpeed; + private System.Windows.Forms.CheckBox chkSlowmo; + } +} + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.cs new file mode 100644 index 0000000..e327d00 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using iRacingSdkWrapper.Bitfields; +using iRacingSdkWrapper.Broadcast; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Examples.BroadcastMessages +{ + public partial class Form1 : Form + { + private readonly SdkWrapper _wrapper; + + public Form1() + { + InitializeComponent(); + + _wrapper = new SdkWrapper(); + _wrapper.Start(); + + LoadDropdowns(); + } + + private void LoadDropdowns() + { + // Replay events + cboReplayEvents.DataSource = Enum.GetValues(typeof (ReplaySearchModeTypes)); + } + + private void btnSetPos_Click(object sender, EventArgs e) + { + _wrapper.Replay.SetPosition((int)numSetPos.Value); + } + + private void btnSetPosEnd_Click(object sender, EventArgs e) + { + _wrapper.Replay.SetPositionFromEnd((int)numSetPosEnd.Value); + } + + private void btnJump_Click(object sender, EventArgs e) + { + var replayEvent = (ReplaySearchModeTypes)cboReplayEvents.SelectedValue; + _wrapper.Replay.Jump(replayEvent); + } + + private void btnSetSpeed_Click(object sender, EventArgs e) + { + _wrapper.Replay.SetPlaybackSpeed((int)numSpeed.Value, chkSlowmo.Checked); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Program.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Program.cs new file mode 100644 index 0000000..5acbca1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace iRacingSdkWrapper.Examples.BroadcastMessages +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1db5773 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSdkWrapper.Examples.BroadcastMessages")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSdkWrapper.Examples.BroadcastMessages")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("426199fd-4cb6-4ab8-8b42-053368f49416")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Resources.Designer.cs new file mode 100644 index 0000000..4364182 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.BroadcastMessages.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSdkWrapper.Examples.BroadcastMessages.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Settings.Designer.cs new file mode 100644 index 0000000..4baecea --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.BroadcastMessages.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/iRacingSdkWrapper.Examples.BroadcastMessages.csproj b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/iRacingSdkWrapper.Examples.BroadcastMessages.csproj new file mode 100644 index 0000000..08aee75 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.BroadcastMessages/iRacingSdkWrapper.Examples.BroadcastMessages.csproj @@ -0,0 +1,100 @@ + + + + + Debug + AnyCPU + {426199FD-4CB6-4AB8-8B42-053368F49416} + WinExe + Properties + iRacingSdkWrapper.Examples.BroadcastMessages + iRacingSdkWrapper.Examples.BroadcastMessages + v4.5.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + {72631B85-EB9A-473E-9B4C-65B355A9000D} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.Designer.cs new file mode 100644 index 0000000..a0a1027 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.Designer.cs @@ -0,0 +1,232 @@ +namespace iRacingSdkWrapper.Examples.Cameras +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.lblFrameStart = new System.Windows.Forms.Label(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); + this.lblEndFrameStart = new System.Windows.Forms.Label(); + this.lblEndFrameEnd = new System.Windows.Forms.Label(); + this.lblFrameEnd = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.button2 = new System.Windows.Forms.Button(); + this.label4 = new System.Windows.Forms.Label(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // lblFrameStart + // + this.lblFrameStart.Location = new System.Drawing.Point(42, 87); + this.lblFrameStart.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFrameStart.Name = "lblFrameStart"; + this.lblFrameStart.Size = new System.Drawing.Size(35, 13); + this.lblFrameStart.TabIndex = 2; + this.lblFrameStart.Text = "0"; + this.lblFrameStart.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // progressBar1 + // + this.progressBar1.Location = new System.Drawing.Point(57, 61); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(375, 23); + this.progressBar1.TabIndex = 3; + // + // lblEndFrameStart + // + this.lblEndFrameStart.Location = new System.Drawing.Point(42, 45); + this.lblEndFrameStart.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblEndFrameStart.Name = "lblEndFrameStart"; + this.lblEndFrameStart.Size = new System.Drawing.Size(35, 13); + this.lblEndFrameStart.TabIndex = 4; + this.lblEndFrameStart.Text = "0"; + this.lblEndFrameStart.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblEndFrameEnd + // + this.lblEndFrameEnd.Location = new System.Drawing.Point(414, 45); + this.lblEndFrameEnd.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblEndFrameEnd.Name = "lblEndFrameEnd"; + this.lblEndFrameEnd.Size = new System.Drawing.Size(35, 13); + this.lblEndFrameEnd.TabIndex = 6; + this.lblEndFrameEnd.Text = "0"; + this.lblEndFrameEnd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // lblFrameEnd + // + this.lblFrameEnd.Location = new System.Drawing.Point(414, 87); + this.lblFrameEnd.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblFrameEnd.Name = "lblFrameEnd"; + this.lblFrameEnd.Size = new System.Drawing.Size(35, 13); + this.lblFrameEnd.TabIndex = 5; + this.lblFrameEnd.Text = "0"; + this.lblFrameEnd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 154); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 13); + this.label1.TabIndex = 7; + this.label1.Text = "label1"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(15, 339); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 8; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(96, 342); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(100, 20); + this.textBox1.TabIndex = 9; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(202, 345); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(34, 13); + this.label2.TabIndex = 10; + this.label2.Text = "Begin"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(202, 371); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(41, 13); + this.label3.TabIndex = 13; + this.label3.Text = "Current"; + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(96, 368); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(100, 20); + this.textBox2.TabIndex = 12; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(15, 365); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(75, 23); + this.button2.TabIndex = 11; + this.button2.Text = "button2"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(202, 397); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(26, 13); + this.label4.TabIndex = 16; + this.label4.Text = "End"; + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(96, 394); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(100, 20); + this.textBox3.TabIndex = 15; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(15, 391); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(75, 23); + this.button3.TabIndex = 14; + this.button3.Text = "button3"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(507, 491); + this.Controls.Add(this.label4); + this.Controls.Add(this.textBox3); + this.Controls.Add(this.button3); + this.Controls.Add(this.label3); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.button2); + this.Controls.Add(this.label2); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.button1); + this.Controls.Add(this.label1); + this.Controls.Add(this.lblEndFrameEnd); + this.Controls.Add(this.lblFrameEnd); + this.Controls.Add(this.lblEndFrameStart); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.lblFrameStart); + this.Margin = new System.Windows.Forms.Padding(2); + this.Name = "Form1"; + this.Padding = new System.Windows.Forms.Padding(9, 10, 9, 10); + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lblFrameStart; + private System.Windows.Forms.ProgressBar progressBar1; + private System.Windows.Forms.Label lblEndFrameStart; + private System.Windows.Forms.Label lblEndFrameEnd; + private System.Windows.Forms.Label lblFrameEnd; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Button button3; + + + } +} + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.cs new file mode 100644 index 0000000..7c19450 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Examples.Cameras +{ + public partial class Form1 : Form + { + private readonly SdkWrapper wrapper; + + public Form1() + { + InitializeComponent(); + + wrapper = new SdkWrapper(); + wrapper.TelemetryUpdateFrequency = 5; + wrapper.SessionInfoUpdated += OnSessionInfoUpdated; + wrapper.TelemetryUpdated += OnTelemetryUpdated; + + wrapper.Start(); + } + + private void OnTelemetryUpdated(object sender, SdkWrapper.TelemetryUpdatedEventArgs e) + { + var replayFrame = e.TelemetryInfo.ReplayFrameNum.Value; + var replayEndFrame = wrapper.GetTelemetryValue("ReplayFrameNumEnd").Value; + var sum = replayFrame + replayEndFrame; + + label1.Text = "ReplayFrameNum: " + replayFrame + + "\n\nReplayFrameNumEnd: " + replayEndFrame + + "\n\nSum: " + sum + + "\n\nSessionTime: " + e.TelemetryInfo.SessionTime.Value + + "\n\nReplaySessionTime: " + e.TelemetryInfo.ReplaySessionTime.Value; + + + progressBar1.Minimum = 0; + progressBar1.Maximum = sum; + progressBar1.Value = replayFrame; + } + + private void OnSessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + } + + private void button1_Click(object sender, EventArgs e) + { + var time = int.Parse(textBox1.Text); + var curTime = wrapper.GetTelemetryValue("SessionTime").Value; + + var diff = curTime - time; + + var frames = (int)(diff*60); + + wrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySetPlayPosition, (int)ReplayPositionModeTypes.End, + frames); + } + + private void button2_Click(object sender, EventArgs e) + { + var frame = int.Parse(textBox2.Text); + wrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySetPlayPosition, (int)ReplayPositionModeTypes.Current, + frame); + } + + private void button3_Click(object sender, EventArgs e) + { + var frame = int.Parse(textBox3.Text); + wrapper.Sdk.BroadcastMessage(BroadcastMessageTypes.ReplaySetPlayPosition, (int)ReplayPositionModeTypes.End, + frame); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Program.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Program.cs new file mode 100644 index 0000000..f116e5b --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace iRacingSdkWrapper.Examples.Cameras +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..611683a --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSdkWrapper.Examples.Cameras")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSdkWrapper.Examples.Cameras")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("c96fb92b-ed14-4cfd-ac7d-852bbf39261a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Resources.Designer.cs new file mode 100644 index 0000000..0badf11 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.Cameras.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSdkWrapper.Examples.Cameras.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Settings.Designer.cs new file mode 100644 index 0000000..93bfa06 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.Cameras.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/iRacingSdkWrapper.Examples.Cameras.csproj b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/iRacingSdkWrapper.Examples.Cameras.csproj new file mode 100644 index 0000000..96e8897 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Cameras/iRacingSdkWrapper.Examples.Cameras.csproj @@ -0,0 +1,95 @@ + + + + + Debug + AnyCPU + {62138F6F-4C30-4B30-948D-81E9EB6FD98B} + WinExe + Properties + iRacingSdkWrapper.Examples.Cameras + iRacingSdkWrapper.Examples.Cameras + v4.0 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247} + iRacingSdkWrapper + + + {72631b85-eb9a-473e-9b4c-65b355a9000d} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Driver.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Driver.cs new file mode 100644 index 0000000..ff55af9 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Driver.cs @@ -0,0 +1,95 @@ +namespace iRacingSdkWrapper.Examples.Drivers +{ + /// + /// Represents a driver in the current session. + /// + public class Driver + { + public Driver() + { + } + + /// + /// The identifier (CarIdx) of this driver (unique to this session) + /// + public int Id { get; set; } + + /// + /// The current position of the driver + /// + public int Position { get; set; } + + /// + /// The name of the driver + /// + public string Name { get; set; } + + /// + /// The customer ID (custid) of the driver + /// + public int CustomerId { get; set; } + + /// + /// The car number of this driver + /// + public string Number { get; set; } + + /// + /// A unique identifier for the car class this driver is using + /// + public int ClassId { get; set; } + + /// + /// The name of the car of this driver + /// + public string CarPath { get; set; } + + /// + /// The relative speed of this class in a multiclass session + /// + public int CarClassRelSpeed { get; set; } + + /// + /// Used to determine if a driver is in the pits, off or on track + /// + public TrackSurfaces TrackSurface { get; set; } + + /// + /// Whether or not the driver is currently in or approaching the pit stall + /// + public bool IsInPits + { + get { return this.TrackSurface == TrackSurfaces.AproachingPits || this.TrackSurface == TrackSurfaces.InPitStall; } + } + + /// + /// The lap this driver is currently in + /// + public int Lap { get; set; } + + /// + /// The distance along the current lap of this driver (in percentage) + /// + public float LapDistance { get; set; } + + /// + /// The relative distance between you and this driver (in percentage). + /// + public float RelativeLapDistance { get; set; } + + /// + /// The fastest lap time of this driver + /// + public float FastestLapTime { get; set; } + + /// + /// The last lap time of this driver + /// + public float LastLapTime { get; set; } + + /// + /// The iRating of this driver + /// + public int Rating { get; set; } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.Designer.cs new file mode 100644 index 0000000..cb3cca8 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.Designer.cs @@ -0,0 +1,93 @@ +namespace iRacingSdkWrapper.Examples.Drivers +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.statusLabel = new System.Windows.Forms.Label(); + this.startButton = new System.Windows.Forms.Button(); + this.driversGrid = new System.Windows.Forms.DataGridView(); + ((System.ComponentModel.ISupportInitialize)(this.driversGrid)).BeginInit(); + this.SuspendLayout(); + // + // statusLabel + // + this.statusLabel.AutoSize = true; + this.statusLabel.Location = new System.Drawing.Point(112, 17); + this.statusLabel.Name = "statusLabel"; + this.statusLabel.Size = new System.Drawing.Size(37, 13); + this.statusLabel.TabIndex = 6; + this.statusLabel.Text = "Status"; + // + // startButton + // + this.startButton.Location = new System.Drawing.Point(12, 12); + this.startButton.Name = "startButton"; + this.startButton.Size = new System.Drawing.Size(75, 23); + this.startButton.TabIndex = 5; + this.startButton.Text = "Start"; + this.startButton.UseVisualStyleBackColor = true; + this.startButton.Click += new System.EventHandler(this.startButton_Click); + // + // driversGrid + // + this.driversGrid.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.driversGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.driversGrid.Location = new System.Drawing.Point(12, 41); + this.driversGrid.Name = "driversGrid"; + this.driversGrid.ReadOnly = true; + this.driversGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.driversGrid.Size = new System.Drawing.Size(936, 452); + this.driversGrid.TabIndex = 7; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(960, 505); + this.Controls.Add(this.driversGrid); + this.Controls.Add(this.statusLabel); + this.Controls.Add(this.startButton); + this.Name = "Form1"; + this.Text = "Form1"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + ((System.ComponentModel.ISupportInitialize)(this.driversGrid)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label statusLabel; + private System.Windows.Forms.Button startButton; + private System.Windows.Forms.DataGridView driversGrid; + } +} + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.cs new file mode 100644 index 0000000..4a43b57 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.cs @@ -0,0 +1,292 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Examples.Drivers +{ + public partial class Form1 : Form + { + private SdkWrapper wrapper; + + private List drivers; + private bool isUpdatingDrivers; + private BindingSource binding; + + private int currentSessionNum; + + public Form1() + { + InitializeComponent(); + + // Create a new instance of the SdkWrapper object + wrapper = new SdkWrapper(); + + // Set some properties + wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread; + wrapper.TelemetryUpdateFrequency = 10; + + // Listen for various events + wrapper.Connected += wrapper_Connected; + wrapper.Disconnected += wrapper_Disconnected; + wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; + wrapper.TelemetryUpdated += wrapper_TelemetryUpdated; + + + // Bind a list of drivers to the grid + binding = new BindingSource(); + drivers = new List(); + binding.DataSource = drivers; + driversGrid.DataSource = binding; + } + + #region Connecting, disconnecting, etc + + private void startButton_Click(object sender, EventArgs e) + { + // If the wrapper is running, stop it. Otherwise, start it. + if (wrapper.IsRunning) + { + wrapper.Stop(); + startButton.Text = "Start"; + } + else + { + wrapper.Start(); + startButton.Text = "Stop"; + } + this.StatusChanged(); + } + + private void StatusChanged() + { + if (wrapper.IsConnected) + { + if (wrapper.IsRunning) + { + statusLabel.Text = "Status: connected!"; + } + else + { + statusLabel.Text = "Status: disconnected."; + } + } + else + { + if (wrapper.IsRunning) + { + statusLabel.Text = "Status: disconnected, waiting for sim..."; + } + else + { + statusLabel.Text = "Status: disconnected"; + } + } + } + + private void wrapper_Connected(object sender, EventArgs e) + { + this.StatusChanged(); + } + + private void wrapper_Disconnected(object sender, EventArgs e) + { + this.StatusChanged(); + } + + #endregion + + #region Events + + private void wrapper_SessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + // Indicate that we are updating the drivers list + isUpdatingDrivers = true; + + // Parse the Drivers section of the session info into a list of drivers + this.ParseDrivers(e.SessionInfo); + + // Parse the ResultsPositions section of the session info to get the positions and times of drivers + this.ParseTimes(e.SessionInfo); + + // Indicate we are finished updating drivers + isUpdatingDrivers = false; + } + + private void wrapper_TelemetryUpdated(object sender, SdkWrapper.TelemetryUpdatedEventArgs e) + { + // Besides the driver details found in the session info, there's also things in the telemetry + // that are properties of a driver, such as their lap, lap distance, track surface, distance relative + // to yourself and more. + // We update the existing list of drivers with the telemetry values here. + + // If we are currently renewing the drivers list it makes little sense to update the existing drivers + // because they will change anyway + if (isUpdatingDrivers) return; + + // Store the current session number so we know which session to read + // There can be multiple sessions in a server (practice, Q, race, or warmup, race, etc). + currentSessionNum = e.TelemetryInfo.SessionNum.Value; + + this.UpdateDriversTelemetry(e.TelemetryInfo); + } + + #endregion + + #region Drivers + + // Parse the YAML DriverInfo section that contains information such as driver id, name, license, car number, etc. + private void ParseDrivers(SessionInfo sessionInfo) + { + int id = 0; + Driver driver; + + var newDrivers = new List(); + + // Loop through drivers until none are found anymore + do + { + driver = null; + + + // Construct a yaml query that finds each driver and his info in the Session Info yaml string + // This query can be re-used for every property for one driver (with the specified id) + YamlQuery query = sessionInfo["DriverInfo"]["Drivers"]["CarIdx", id]; + + + + // Try to get the UserName of the driver (because its the first value given) + // If the UserName value is not found (name == null) then we found all drivers and we can stop + string name = query["UserName"].GetValue(); + if (name != null) + { + // Find this driver in the list + // This strange " => " syntax is called a lambda expression and is short for a loop through all drivers + // Read as: select the first driver 'd', if any, whose Name is equal to name. + driver = drivers.FirstOrDefault(d => d.Name == name); + + if (driver == null) + { + // Or create a new Driver if we didn't find him before + driver = new Driver(); + driver.Id = id; + driver.Name = name; + driver.CustomerId = int.Parse(query["UserID"].GetValue("0")); // default value 0 + driver.Number = query["CarNumber"].GetValue("").TrimStart('\"').TrimEnd('\"'); // trim the quotes + driver.ClassId = int.Parse(query["CarClassID"].GetValue("0")); + driver.CarPath = query["CarPath"].GetValue(); + driver.CarClassRelSpeed = int.Parse(query["CarClassRelSpeed"].GetValue("0")); + driver.Rating = int.Parse(query["IRating"].GetValue("0")); + } + newDrivers.Add(driver); + + id++; + } + } while (driver != null); + + // Replace old list of drivers with new list of drivers and update the grid + drivers.Clear(); + drivers.AddRange(newDrivers); + + this.UpdateDriversGrid(); + } + + // Parse the YAML SessionInfo section that contains information such as lap times, position, etc. + private void ParseTimes(SessionInfo sessionInfo) + { + int position = 1; + Driver driver = null; + + // Loop through positions starting at 1 until no more are found + do + { + driver = null; + + // Construct a yaml query that we can re-use again + YamlQuery query = sessionInfo["SessionInfo"]["Sessions"]["SessionNum", currentSessionNum] + ["ResultsPositions"]["Position", position]; + + + // Find the car id belonging to the current position + string idString = query["CarIdx"].GetValue(); + if (idString != null) + { + int id = int.Parse(idString); + + // Find the corresponding driver from the list + // This strange " => " syntax is called a lambda expression and is short for a loop through all drivers + // Read as: select the first driver 'd', if any, whose Id is equal to id. + driver = drivers.FirstOrDefault(d => d.Id == id); + + if (driver != null) + { + driver.Position = position; + driver.FastestLapTime = float.Parse(query["FastestTime"].GetValue("0"), CultureInfo.InvariantCulture); + driver.LastLapTime = float.Parse(query["LastTime"].GetValue("0"), CultureInfo.InvariantCulture); + } + + position++; + } + + } while (driver != null); + } + + private void UpdateDriversTelemetry(TelemetryInfo info) + { + // Get your own driver entry + // This strange " => " syntax is called a lambda expression and is short for a loop through all drivers + Driver me = drivers.FirstOrDefault(d => d.Id == wrapper.DriverId); + + // Get arrays of the laps, distances, track surfaces of every driver + var laps = info.CarIdxLap.Value; + var lapDistances = info.CarIdxLapDistPct.Value; + var trackSurfaces = info.CarIdxTrackSurface.Value; + + // Loop through the list of current drivers + foreach (Driver driver in drivers) + { + // Set the lap, distance, tracksurface belonging to this driver + driver.Lap = laps[driver.Id]; + driver.LapDistance = lapDistances[driver.Id]; + driver.TrackSurface = trackSurfaces[driver.Id]; + + // If your own driver exists, use it to calculate the relative distance between you and the other driver + if (me != null) + { + var relative = driver.LapDistance - me.LapDistance; + + // If driver is more than half the track behind, subtract 100% track length + // and vice versa + if (relative > 0.5) relative -= 1; + else if (relative < -0.5) relative += 1; + + driver.RelativeLapDistance = relative; + } + else + { + driver.RelativeLapDistance = -1; + } + } + + this.UpdateDriversGrid(); + } + + private void UpdateDriversGrid() + { + binding.ResetBindings(false); + } + + #endregion + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + wrapper.Stop(); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Program.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Program.cs new file mode 100644 index 0000000..dcc4ef1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace iRacingSdkWrapper.Examples.Drivers +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bd8cd17 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSdkWrapper.Examples.Drivers")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSdkWrapper.Examples.Drivers")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6b622e25-f8c6-4107-ad5d-7769c1cf2133")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Resources.Designer.cs new file mode 100644 index 0000000..58b941c --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.Drivers.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSdkWrapper.Examples.Drivers.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Settings.Designer.cs new file mode 100644 index 0000000..da331c9 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.269 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.Drivers.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/iRacingSdkWrapper.Examples.Drivers.csproj b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/iRacingSdkWrapper.Examples.Drivers.csproj new file mode 100644 index 0000000..4fc3abb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Drivers/iRacingSdkWrapper.Examples.Drivers.csproj @@ -0,0 +1,98 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {33AAA857-4D78-423E-8D0E-1D1CBC8A45E6} + WinExe + Properties + iRacingSdkWrapper.Examples.Drivers + iRacingSdkWrapper.Examples.Drivers + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247} + iRacingSdkWrapper + + + {72631B85-EB9A-473E-9B4C-65B355A9000D} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Driver.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Driver.vb new file mode 100644 index 0000000..10e8a4f --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Driver.vb @@ -0,0 +1,91 @@ +''' +''' Represents a driver in the current session. +''' +Public Class Driver + Public Sub New() + End Sub + + ''' + ''' The identifier (CarIdx) of this driver (unique to this session) + ''' + Public Property Id As Integer + + ''' + ''' The current position of the driver + ''' + Public Property Position As Integer + + ''' + ''' The name of the driver + ''' + Public Property Name As String + + ''' + ''' The customer ID (custid) of the driver + ''' + Public Property CustomerId As Integer + + ''' + ''' The car number of this driver + ''' + Public Property Number As String + + ''' + ''' A unique identifier for the car class this driver is using + ''' + Public Property ClassId As Integer + + ''' + ''' The name of the car of this driver + ''' + Public Property CarPath As String + + ''' + ''' The relative speed of this class in a multiclass session + ''' + Public Property CarClassRelSpeed As Integer + + ''' + ''' Used to determine if a driver is in the pits, off or on track + ''' + Public Property TrackSurface As TrackSurfaces + + ''' + ''' Whether or not the driver is currently in or approaching the pit stall + ''' + Public ReadOnly Property IsInPits() As Boolean + Get + Return Me.TrackSurface = TrackSurfaces.AproachingPits OrElse Me.TrackSurface = TrackSurfaces.InPitStall + End Get + End Property + + ''' + ''' The lap this driver is currently in + ''' + Public Property Lap As Integer + + ''' + ''' The distance along the current lap of this driver (in percentage) + ''' + Public Property LapDistance As Single + + ''' + ''' The relative distance between you and this driver (in percentage). + ''' + Public Property RelativeLapDistance As Single + + ''' + ''' The fastest lap time of this driver + ''' + Public Property FastestLapTime As Single + + ''' + ''' The last lap time of this driver + ''' + Public Property LastLapTime As Single + + ''' + ''' The iRating of this driver + ''' + Public Property Rating As Integer +End Class \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.Designer.vb new file mode 100644 index 0000000..a26b97a --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.Designer.vb @@ -0,0 +1,84 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.driversGrid = New System.Windows.Forms.DataGridView() + Me.statusLabel = New System.Windows.Forms.Label() + Me.startButton = New System.Windows.Forms.Button() + CType(Me.driversGrid, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'driversGrid + ' + Me.driversGrid.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.driversGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.driversGrid.Location = New System.Drawing.Point(13, 48) + Me.driversGrid.Margin = New System.Windows.Forms.Padding(4) + Me.driversGrid.Name = "driversGrid" + Me.driversGrid.ReadOnly = True + Me.driversGrid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.driversGrid.Size = New System.Drawing.Size(1138, 526) + Me.driversGrid.TabIndex = 10 + ' + 'statusLabel + ' + Me.statusLabel.AutoSize = True + Me.statusLabel.Location = New System.Drawing.Point(146, 19) + Me.statusLabel.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.statusLabel.Name = "statusLabel" + Me.statusLabel.Size = New System.Drawing.Size(48, 17) + Me.statusLabel.TabIndex = 9 + Me.statusLabel.Text = "Status" + ' + 'startButton + ' + Me.startButton.Location = New System.Drawing.Point(13, 13) + Me.startButton.Margin = New System.Windows.Forms.Padding(4) + Me.startButton.Name = "startButton" + Me.startButton.Size = New System.Drawing.Size(100, 28) + Me.startButton.TabIndex = 8 + Me.startButton.Text = "Start" + Me.startButton.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(1164, 587) + Me.Controls.Add(Me.driversGrid) + Me.Controls.Add(Me.statusLabel) + Me.Controls.Add(Me.startButton) + Me.Name = "Form1" + Me.Text = "Form1" + CType(Me.driversGrid, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Private WithEvents driversGrid As System.Windows.Forms.DataGridView + Private WithEvents statusLabel As System.Windows.Forms.Label + Private WithEvents startButton As System.Windows.Forms.Button + +End Class diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.vb new file mode 100644 index 0000000..6730176 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/Form1.vb @@ -0,0 +1,262 @@ +Option Strict On + +Imports System.Globalization + +Public Class Form1 + + Private wrapper As SdkWrapper + + Private drivers As List(Of Driver) + Private isUpdatingDrivers As Boolean + Private binding As BindingSource + + Private currentSessionNum As Integer + + Public Sub New() + InitializeComponent() + + ' Create a new instance of the SdkWrapper object + wrapper = New SdkWrapper() + + ' Set some properties + wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread + wrapper.TelemetryUpdateFrequency = 10 + + ' Listen for various events + AddHandler wrapper.Connected, AddressOf wrapper_Connected + AddHandler wrapper.Disconnected, AddressOf wrapper_Disconnected + AddHandler wrapper.SessionInfoUpdated, AddressOf wrapper_SessionInfoUpdated + AddHandler wrapper.TelemetryUpdated, AddressOf wrapper_TelemetryUpdated + + + ' Bind a list of drivers to the grid + binding = New BindingSource() + drivers = New List(Of Driver)() + binding.DataSource = drivers + driversGrid.DataSource = binding + End Sub + +#Region "Connecting, disconnecting, etc" + + Private Sub startButton_Click(sender As Object, e As EventArgs) Handles startButton.Click + ' If the wrapper is running, stop it. Otherwise, start it. + If wrapper.IsRunning Then + wrapper.[Stop]() + startButton.Text = "Start" + Else + wrapper.Start() + startButton.Text = "Stop" + End If + Me.StatusChanged() + End Sub + + Private Sub StatusChanged() + If wrapper.IsConnected Then + If wrapper.IsRunning Then + statusLabel.Text = "Status: connected!" + Else + statusLabel.Text = "Status: disconnected." + End If + Else + If wrapper.IsRunning Then + statusLabel.Text = "Status: disconnected, waiting for sim..." + Else + statusLabel.Text = "Status: disconnected" + End If + End If + End Sub + + Private Sub wrapper_Connected(sender As Object, e As EventArgs) + Me.StatusChanged() + End Sub + + Private Sub wrapper_Disconnected(sender As Object, e As EventArgs) + Me.StatusChanged() + End Sub + +#End Region + +#Region "Events" + + Private Sub wrapper_SessionInfoUpdated(sender As Object, e As SdkWrapper.SessionInfoUpdatedEventArgs) + ' Indicate that we are updating the drivers list + isUpdatingDrivers = True + + ' Parse the Drivers section of the session info into a list of drivers + Me.ParseDrivers(e.SessionInfo) + + ' Parse the ResultsPositions section of the session info to get the positions and times of drivers + Me.ParseTimes(e.SessionInfo) + + ' Indicate we are finished updating drivers + isUpdatingDrivers = False + End Sub + + Private Sub wrapper_TelemetryUpdated(sender As Object, e As SdkWrapper.TelemetryUpdatedEventArgs) + ' Besides the driver details found in the session info, there's also things in the telemetry + ' that are properties of a driver, such as their lap, lap distance, track surface, distance relative + ' to yourself and more. + ' We update the existing list of drivers with the telemetry values here. + + ' If we are currently renewing the drivers list it makes little sense to update the existing drivers + ' because they will change anyway + If isUpdatingDrivers Then + Return + End If + + ' Store the current session number so we know which session to read + ' There can be multiple sessions in a server (practice, Q, race, or warmup, race, etc). + currentSessionNum = e.TelemetryInfo.SessionNum.Value + + Me.UpdateDriversTelemetry(e.TelemetryInfo) + End Sub + +#End Region + +#Region "Drivers" + + ' Parse the YAML DriverInfo section that contains information such as driver id, name, license, car number, etc. + Private Sub ParseDrivers(sessionInfo As SessionInfo) + ' This string is used for every property of the driver + ' {0} is replaced by the driver ID + ' {1} is replaced by the property key + ' The result is a string like: DriverInfo:Drivers:CarIdx:{17}CarNumber: + ' which is the correct way to request the property 'CarNumber' from the driver with id 17. + Const driverYamlPath As String = "DriverInfo:Drivers:CarIdx:{{{0}}}{1}:" + + Dim id As Integer = 0 + Dim driver As Driver + + Dim newDrivers = New List(Of Driver)() + + + ' Loop through drivers until none are found anymore + Do + driver = Nothing + + ' Construct a yaml query that finds each driver and his info in the Session Info yaml string + ' This query can be re-used for every property for one driver (with the specified id) + Dim query As YamlQuery = sessionInfo("DriverInfo")("Drivers")("CarIdx", id) + + ' Try to get the UserName of the driver (because its the first value given) + ' If the UserName value is not found (name == null) then we found all drivers and we can stop + Dim name As String = query("UserName").GetValue() + If name IsNot Nothing Then + ' Find this driver in the list + ' This strange "Function(d)" syntax is called a lambda expression and is short for a loop through all drivers + ' Read as: select the first driver 'd', if any, whose Name is equal to name. + driver = drivers.FirstOrDefault(Function(d) d.Name = name) + + If driver Is Nothing Then + ' Or create a new Driver if we didn't find him before + driver = New Driver() + driver.Id = id + driver.Name = name + driver.CustomerId = Integer.Parse(query("UserID").GetValue("0")) ' default value 0 + driver.Number = query("CarNumber").GetValue("").TrimStart(""""c).TrimEnd(""""c) ' trim the quotes + driver.ClassId = Integer.Parse(query("CarClassID").GetValue("0")) + driver.CarPath = query("CarPath").GetValue() + driver.CarClassRelSpeed = Integer.Parse(query("CarClassRelSpeed").GetValue("0")) + driver.Rating = Integer.Parse(query("IRating").GetValue("0")) + End If + newDrivers.Add(driver) + + id += 1 + End If + Loop While driver IsNot Nothing + + + ' Replace old list of drivers with new list of drivers and update the grid + drivers.Clear() + drivers.AddRange(newDrivers) + + Me.UpdateDriversGrid() + End Sub + + ' Parse the YAML SessionInfo section that contains information such as lap times, position, etc. + Private Sub ParseTimes(sessionInfo As SessionInfo) + + Dim position As Integer = 1 + Dim driver As Driver = Nothing + + + ' Loop through positions starting at 1 until no more are found + Do + driver = Nothing + + ' Construct a yaml query that we can re-use again + Dim query As YamlQuery = sessionInfo("SessionInfo")("Sessions")("SessionNum", currentSessionNum) _ + ("ResultsPositions")("Position", position) + + + ' Find the car id belonging to the current position + Dim idString As String = query("CarIdx").GetValue() + If idString IsNot Nothing Then + Dim id As Integer = Integer.Parse(idString) + + ' Find the corresponding driver from the list + ' This strange " => " syntax is called a lambda expression and is short for a loop through all drivers + ' Read as: select the first driver 'd', if any, whose Id is equal to id. + driver = drivers.FirstOrDefault(Function(d) d.Id = id) + + If driver IsNot Nothing Then + driver.Position = position + driver.FastestLapTime = Single.Parse(query("FastestTime").GetValue("0"), CultureInfo.InvariantCulture) + driver.LastLapTime = Single.Parse(query("LastTime").GetValue("0"), CultureInfo.InvariantCulture) + End If + + position += 1 + + End If + Loop While driver IsNot Nothing + End Sub + + Private Sub UpdateDriversTelemetry(info As TelemetryInfo) + ' Get your own driver entry + ' This strange " => " syntax is called a lambda expression and is short for a loop through all drivers + Dim [me] As Driver = drivers.FirstOrDefault(Function(d) d.Id = wrapper.DriverId) + + ' Get arrays of the laps, distances, track surfaces of every driver + Dim laps = info.CarIdxLap.Value + Dim lapDistances = info.CarIdxLapDistPct.Value + Dim trackSurfaces = info.CarIdxTrackSurface.Value + + ' Loop through the list of current drivers + For Each driver As Driver In drivers + ' Set the lap, distance, tracksurface belonging to this driver + driver.Lap = laps(driver.Id) + driver.LapDistance = lapDistances(driver.Id) + driver.TrackSurface = trackSurfaces(driver.Id) + + ' If your own driver exists, use it to calculate the relative distance between you and the other driver + If [me] IsNot Nothing Then + Dim relative = driver.LapDistance - [me].LapDistance + + ' If driver is more than half the track behind, subtract 100% track length + ' and vice versa + If relative > 0.5 Then + relative -= 1 + ElseIf relative < -0.5 Then + relative += 1 + End If + + driver.RelativeLapDistance = relative + Else + driver.RelativeLapDistance = -1 + End If + Next + + Me.UpdateDriversGrid() + End Sub + + Private Sub UpdateDriversGrid() + binding.ResetBindings(False) + End Sub + +#End Region + + Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing + wrapper.[Stop]() + End Sub + +End Class diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Application.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Application.Designer.vb new file mode 100644 index 0000000..153b1f6 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.18444 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.iRacingSdkWrapper.Examples.DriversVB.Form1 + End Sub + End Class +End Namespace diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Application.myapp b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/AssemblyInfo.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..a2866cc --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Resources.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Resources.Designer.vb new file mode 100644 index 0000000..d64426b --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.18444 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("iRacingSdkWrapper.Examples.DriversVB.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Settings.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Settings.Designer.vb new file mode 100644 index 0000000..7dd49ce --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.18444 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.iRacingSdkWrapper.Examples.DriversVB.My.MySettings + Get + Return Global.iRacingSdkWrapper.Examples.DriversVB.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/iRacingSdkWrapper.Examples.DriversVB.vbproj b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/iRacingSdkWrapper.Examples.DriversVB.vbproj new file mode 100644 index 0000000..a1ae0da --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.DriversVB/iRacingSdkWrapper.Examples.DriversVB.vbproj @@ -0,0 +1,132 @@ + + + + + Debug + AnyCPU + {180D20E0-5745-4193-879E-FC6DCA3DFD65} + WinExe + iRacingSdkWrapper.Examples.DriversVB.My.MyApplication + iRacingSdkWrapper.Examples.DriversVB + iRacingSdkWrapper.Examples.DriversVB + 512 + WindowsForms + v4.0 + + + AnyCPU + true + full + true + true + bin\Debug\ + iRacingSdkWrapper.Examples.DriversVB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + AnyCPU + pdbonly + false + true + true + bin\Release\ + iRacingSdkWrapper.Examples.DriversVB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.Designer.cs new file mode 100644 index 0000000..5450bc5 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.Designer.cs @@ -0,0 +1,168 @@ +namespace iRacingSdkWrapperExample +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.startButton = new System.Windows.Forms.Button(); + this.sessionInfoTextBox = new System.Windows.Forms.TextBox(); + this.telemetryTextBox = new System.Windows.Forms.TextBox(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.sessionInfoLabel = new System.Windows.Forms.Label(); + this.telemetryLabel = new System.Windows.Forms.Label(); + this.statusLabel = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.SuspendLayout(); + // + // startButton + // + this.startButton.Location = new System.Drawing.Point(16, 15); + this.startButton.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.startButton.Name = "startButton"; + this.startButton.Size = new System.Drawing.Size(100, 28); + this.startButton.TabIndex = 0; + this.startButton.Text = "Start"; + this.startButton.UseVisualStyleBackColor = true; + this.startButton.Click += new System.EventHandler(this.startButton_Click); + // + // sessionInfoTextBox + // + this.sessionInfoTextBox.BackColor = System.Drawing.SystemColors.Control; + this.sessionInfoTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.sessionInfoTextBox.Location = new System.Drawing.Point(0, 17); + this.sessionInfoTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.sessionInfoTextBox.Multiline = true; + this.sessionInfoTextBox.Name = "sessionInfoTextBox"; + this.sessionInfoTextBox.ReadOnly = true; + this.sessionInfoTextBox.Size = new System.Drawing.Size(530, 477); + this.sessionInfoTextBox.TabIndex = 0; + // + // telemetryTextBox + // + this.telemetryTextBox.BackColor = System.Drawing.SystemColors.Control; + this.telemetryTextBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.telemetryTextBox.Location = new System.Drawing.Point(0, 17); + this.telemetryTextBox.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.telemetryTextBox.Multiline = true; + this.telemetryTextBox.Name = "telemetryTextBox"; + this.telemetryTextBox.ReadOnly = true; + this.telemetryTextBox.Size = new System.Drawing.Size(541, 477); + this.telemetryTextBox.TabIndex = 2; + // + // splitContainer1 + // + this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.splitContainer1.Location = new System.Drawing.Point(16, 50); + this.splitContainer1.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.sessionInfoTextBox); + this.splitContainer1.Panel1.Controls.Add(this.sessionInfoLabel); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.telemetryTextBox); + this.splitContainer1.Panel2.Controls.Add(this.telemetryLabel); + this.splitContainer1.Size = new System.Drawing.Size(1076, 494); + this.splitContainer1.SplitterDistance = 530; + this.splitContainer1.SplitterWidth = 5; + this.splitContainer1.TabIndex = 3; + // + // sessionInfoLabel + // + this.sessionInfoLabel.AutoSize = true; + this.sessionInfoLabel.Dock = System.Windows.Forms.DockStyle.Top; + this.sessionInfoLabel.Location = new System.Drawing.Point(0, 0); + this.sessionInfoLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.sessionInfoLabel.Name = "sessionInfoLabel"; + this.sessionInfoLabel.Size = new System.Drawing.Size(85, 17); + this.sessionInfoLabel.TabIndex = 1; + this.sessionInfoLabel.Text = "Session info"; + // + // telemetryLabel + // + this.telemetryLabel.AutoSize = true; + this.telemetryLabel.Dock = System.Windows.Forms.DockStyle.Top; + this.telemetryLabel.Location = new System.Drawing.Point(0, 0); + this.telemetryLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.telemetryLabel.Name = "telemetryLabel"; + this.telemetryLabel.Size = new System.Drawing.Size(71, 17); + this.telemetryLabel.TabIndex = 3; + this.telemetryLabel.Text = "Telemetry"; + // + // statusLabel + // + this.statusLabel.AutoSize = true; + this.statusLabel.Location = new System.Drawing.Point(149, 21); + this.statusLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.statusLabel.Name = "statusLabel"; + this.statusLabel.Size = new System.Drawing.Size(48, 17); + this.statusLabel.TabIndex = 4; + this.statusLabel.Text = "Status"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1108, 559); + this.Controls.Add(this.statusLabel); + this.Controls.Add(this.splitContainer1); + this.Controls.Add(this.startButton); + this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.Name = "Form1"; + this.Text = "Form1"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button startButton; + private System.Windows.Forms.TextBox sessionInfoTextBox; + private System.Windows.Forms.TextBox telemetryTextBox; + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.Label sessionInfoLabel; + private System.Windows.Forms.Label telemetryLabel; + private System.Windows.Forms.Label statusLabel; + } +} + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.cs new file mode 100644 index 0000000..24f4bb0 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.cs @@ -0,0 +1,219 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using iRSDKSharp; +using iRacingSdkWrapper; +using iRacingSdkWrapper.Bitfields; + +namespace iRacingSdkWrapperExample +{ + public partial class Form1 : Form + { + private SdkWrapper wrapper; + + public Form1() + { + InitializeComponent(); + + // Create a new instance of the SdkWrapper object + wrapper = new SdkWrapper(); + + // Tell it to raise events on the current thread (don't worry if you don't know what a thread is) + wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread; + + // Only update telemetry 10 times per second + wrapper.TelemetryUpdateFrequency = 10; + + // Attach some useful events so you can respond when they get raised + wrapper.Connected += wrapper_Connected; + wrapper.Disconnected += wrapper_Disconnected; + wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; + wrapper.TelemetryUpdated += wrapper_TelemetryUpdated; + } + + private void startButton_Click(object sender, EventArgs e) + { + // If the wrapper is running, stop it. Otherwise, start it. + if (wrapper.IsRunning) + { + wrapper.Stop(); + startButton.Text = "Start"; + } + else + { + wrapper.Start(); + startButton.Text = "Stop"; + } + + this.StatusChanged(); + } + + private void StatusChanged() + { + if (wrapper.IsConnected) + { + if (wrapper.IsRunning) + { + statusLabel.Text = "Status: connected!"; + } + else + { + statusLabel.Text = "Status: disconnected."; + } + } + else + { + if (wrapper.IsRunning) + { + statusLabel.Text = "Status: disconnected, waiting for sim..."; + } + else + { + statusLabel.Text = "Status: disconnected"; + } + } + } + + // Event handler called when the sdk wrapper connects (eg, you start it, or the sim is started) + private void wrapper_Connected(object sender, EventArgs e) + { + this.StatusChanged(); + } + + // Event handler called when the sdk wrapper disconnects (eg, the sim closes) + private void wrapper_Disconnected(object sender, EventArgs e) + { + this.StatusChanged(); + } + + // Event handler called when the session info is updated + // This typically happens when a car crosses the finish line for example + private void wrapper_SessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + sessionInfoLabel.Text = string.Format("Session info (last update time: {0})", e.UpdateTime); + + // Let's just dump the session info: + sessionInfoTextBox.Text = e.SessionInfo.Yaml; + + // Read some values using a YAML query + string trackName = e.SessionInfo.GetValue("WeekendInfo:TrackName:"); + int sessionId = int.Parse(e.SessionInfo.GetValue("WeekendInfo:SessionId:")); + string windSpeed = e.SessionInfo.GetValue("WeekendInfo:WeekendOptions:WindSpeed:"); + + // Read some values with the easier notation (no need to write the YAML query) + var trackLength = e.SessionInfo["WeekendInfo"]["TrackLength"].GetValue(); + var driver1Name = e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", 1]["UserName"].GetValue(); + + // Attempt to read the username of a random driver safely + var random = new Random(); + var id = random.Next(0, 60); + + string driverName; + if (e.SessionInfo["DriverInfo"]["Drivers"]["CarIdx", id]["UserName"].TryGetValue(out driverName)) + { + // Success + MessageBox.Show(driverName); + } + else + { + // not found + MessageBox.Show("Error retrieving name of driver " + id); + } + } + + // Event handler called when the telemetry is updated + // This happens (max) 60 times per second + private void wrapper_TelemetryUpdated(object sender, SdkWrapper.TelemetryUpdatedEventArgs e) + { + telemetryLabel.Text = string.Format("Telemetry (last updated {0})", DateTime.Now.TimeOfDay.ToString()); + + // Let's just write some random values: + StringBuilder sb = new StringBuilder(); + + this.TelemetryExample(sb, e); + this.ArrayExample(sb, e); + this.BitfieldsExample(sb, e); + + // Get a (fictional) value that is not covered in the TelemetryInfo properties + var fictionalObject = wrapper.GetTelemetryValue("VariableName"); + var fictionalValue = fictionalObject.Value; + + telemetryTextBox.Text = sb.ToString(); + } + + #region Simple telemetry examples + + // Example method that adds speed and roll values to the string builder + private void TelemetryExample(StringBuilder sb, SdkWrapper.TelemetryUpdatedEventArgs e) + { + // Important distinction: TelemetryInfo.Speed (for example) returns an object of type TelemetryValue. + // This object contains more than just the value; also the unit, name and a description. + // To get just the value, you use the Value property. + // This goes for every property of the TelemetryInfo class. + + sb.AppendLine("Speed: " + e.TelemetryInfo.Speed.Value); // Without unit + sb.AppendLine("Speed: " + e.TelemetryInfo.Speed.ToString()); // with unit + sb.AppendLine("Roll: " + e.TelemetryInfo.Roll.ToString()); + } + + // Example method that adds some data such as your lap distance and track surface to the string builder + private void ArrayExample(StringBuilder sb, SdkWrapper.TelemetryUpdatedEventArgs e) + { + // Get your own CarIdx: + int myId = wrapper.DriverId; + + // Get the arrays you want + float[] lapDistances = e.TelemetryInfo.CarIdxLapDistPct.Value; + TrackSurfaces[] surfaces = e.TelemetryInfo.CarIdxTrackSurface.Value; + + // Your car data is at your id index; + float myLapDistance = lapDistances[myId]; + TrackSurfaces mySurface = surfaces[myId]; + + sb.AppendLine("My lap distance: " + myLapDistance); + sb.AppendLine("My track surface: " + mySurface.ToString()); + } + + // Example method that adds some caution flags to the string builder if they are displayed in the sim + private void BitfieldsExample(StringBuilder sb, SdkWrapper.TelemetryUpdatedEventArgs e) + { + // The value of SessionFlags returns a SessionFlag object which contains information about all currently active flags + // Use the Contains method to check if it contains a specific flag. + + // EngineWarnings and CameraStates behave similarly. + + SessionFlag flags = e.TelemetryInfo.SessionFlags.Value; + + if (flags.Contains(SessionFlags.Black)) + { + sb.AppendLine("Black flag!"); + } + if (flags.Contains(SessionFlags.Disqualify)) + { + sb.AppendLine("DQ"); + } + if (flags.Contains(SessionFlags.Repair)) + { + sb.AppendLine("Repair"); + } + if (flags.Contains(SessionFlags.Checkered)) + { + sb.AppendLine("Checkered"); + } + } + + #endregion + + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + wrapper.Stop(); + } + + + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Program.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Program.cs new file mode 100644 index 0000000..57dfd9f --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Program.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; + +namespace iRacingSdkWrapperExample +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c9d3781 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSdkWrapperExample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSdkWrapperExample")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("fd1d79d5-3d2d-42a5-b5bb-0c093a480c47")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Resources.Designer.cs new file mode 100644 index 0000000..188e6ea --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapperExample.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSdkWrapperExample.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Settings.Designer.cs new file mode 100644 index 0000000..118910d --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapperExample.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/iRacingSdkWrapper.Examples.Simple.csproj b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/iRacingSdkWrapper.Examples.Simple.csproj new file mode 100644 index 0000000..104fa69 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.Simple/iRacingSdkWrapper.Examples.Simple.csproj @@ -0,0 +1,97 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {80FEE2A7-8069-445A-8AF2-DC750C56E139} + WinExe + Properties + iRacingSdkWrapperExample + iRacingSdkWrapperExample + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247} + iRacingSdkWrapper + + + {72631B85-EB9A-473E-9B4C-65B355A9000D} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/App.config b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/App.config new file mode 100644 index 0000000..64f3722 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.Designer.vb new file mode 100644 index 0000000..dca17ea --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.Designer.vb @@ -0,0 +1,147 @@ + _ +Partial Class Form1 + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.statusLabel = New System.Windows.Forms.Label() + Me.telemetryLabel = New System.Windows.Forms.Label() + Me.sessionInfoLabel = New System.Windows.Forms.Label() + Me.splitContainer1 = New System.Windows.Forms.SplitContainer() + Me.sessionInfoTextBox = New System.Windows.Forms.TextBox() + Me.telemetryTextBox = New System.Windows.Forms.TextBox() + Me.startButton = New System.Windows.Forms.Button() + CType(Me.splitContainer1, System.ComponentModel.ISupportInitialize).BeginInit() + Me.splitContainer1.Panel1.SuspendLayout() + Me.splitContainer1.Panel2.SuspendLayout() + Me.splitContainer1.SuspendLayout() + Me.SuspendLayout() + ' + 'statusLabel + ' + Me.statusLabel.AutoSize = True + Me.statusLabel.Location = New System.Drawing.Point(112, 17) + Me.statusLabel.Name = "statusLabel" + Me.statusLabel.Size = New System.Drawing.Size(37, 13) + Me.statusLabel.TabIndex = 7 + Me.statusLabel.Text = "Status" + ' + 'telemetryLabel + ' + Me.telemetryLabel.AutoSize = True + Me.telemetryLabel.Dock = System.Windows.Forms.DockStyle.Top + Me.telemetryLabel.Location = New System.Drawing.Point(0, 0) + Me.telemetryLabel.Name = "telemetryLabel" + Me.telemetryLabel.Size = New System.Drawing.Size(53, 13) + Me.telemetryLabel.TabIndex = 3 + Me.telemetryLabel.Text = "Telemetry" + ' + 'sessionInfoLabel + ' + Me.sessionInfoLabel.AutoSize = True + Me.sessionInfoLabel.Dock = System.Windows.Forms.DockStyle.Top + Me.sessionInfoLabel.Location = New System.Drawing.Point(0, 0) + Me.sessionInfoLabel.Name = "sessionInfoLabel" + Me.sessionInfoLabel.Size = New System.Drawing.Size(64, 13) + Me.sessionInfoLabel.TabIndex = 1 + Me.sessionInfoLabel.Text = "Session info" + ' + 'splitContainer1 + ' + Me.splitContainer1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.splitContainer1.Location = New System.Drawing.Point(12, 41) + Me.splitContainer1.Name = "splitContainer1" + ' + 'splitContainer1.Panel1 + ' + Me.splitContainer1.Panel1.Controls.Add(Me.sessionInfoTextBox) + Me.splitContainer1.Panel1.Controls.Add(Me.sessionInfoLabel) + ' + 'splitContainer1.Panel2 + ' + Me.splitContainer1.Panel2.Controls.Add(Me.telemetryTextBox) + Me.splitContainer1.Panel2.Controls.Add(Me.telemetryLabel) + Me.splitContainer1.Size = New System.Drawing.Size(775, 376) + Me.splitContainer1.SplitterDistance = 382 + Me.splitContainer1.TabIndex = 6 + ' + 'sessionInfoTextBox + ' + Me.sessionInfoTextBox.BackColor = System.Drawing.SystemColors.Control + Me.sessionInfoTextBox.Dock = System.Windows.Forms.DockStyle.Fill + Me.sessionInfoTextBox.Location = New System.Drawing.Point(0, 13) + Me.sessionInfoTextBox.Multiline = True + Me.sessionInfoTextBox.Name = "sessionInfoTextBox" + Me.sessionInfoTextBox.ReadOnly = True + Me.sessionInfoTextBox.Size = New System.Drawing.Size(382, 363) + Me.sessionInfoTextBox.TabIndex = 0 + ' + 'telemetryTextBox + ' + Me.telemetryTextBox.BackColor = System.Drawing.SystemColors.Control + Me.telemetryTextBox.Dock = System.Windows.Forms.DockStyle.Fill + Me.telemetryTextBox.Location = New System.Drawing.Point(0, 13) + Me.telemetryTextBox.Multiline = True + Me.telemetryTextBox.Name = "telemetryTextBox" + Me.telemetryTextBox.ReadOnly = True + Me.telemetryTextBox.Size = New System.Drawing.Size(389, 363) + Me.telemetryTextBox.TabIndex = 2 + ' + 'startButton + ' + Me.startButton.Location = New System.Drawing.Point(12, 12) + Me.startButton.Name = "startButton" + Me.startButton.Size = New System.Drawing.Size(75, 23) + Me.startButton.TabIndex = 5 + Me.startButton.Text = "Start" + Me.startButton.UseVisualStyleBackColor = True + ' + 'Form1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(799, 429) + Me.Controls.Add(Me.statusLabel) + Me.Controls.Add(Me.splitContainer1) + Me.Controls.Add(Me.startButton) + Me.Name = "Form1" + Me.Text = "Form1" + Me.splitContainer1.Panel1.ResumeLayout(False) + Me.splitContainer1.Panel1.PerformLayout() + Me.splitContainer1.Panel2.ResumeLayout(False) + Me.splitContainer1.Panel2.PerformLayout() + CType(Me.splitContainer1, System.ComponentModel.ISupportInitialize).EndInit() + Me.splitContainer1.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Private WithEvents statusLabel As System.Windows.Forms.Label + Private WithEvents telemetryLabel As System.Windows.Forms.Label + Private WithEvents sessionInfoLabel As System.Windows.Forms.Label + Private WithEvents splitContainer1 As System.Windows.Forms.SplitContainer + Private WithEvents sessionInfoTextBox As System.Windows.Forms.TextBox + Private WithEvents telemetryTextBox As System.Windows.Forms.TextBox + Private WithEvents startButton As System.Windows.Forms.Button + +End Class diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.vb new file mode 100644 index 0000000..a2ba7b9 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/Form1.vb @@ -0,0 +1,180 @@ +Imports System.Text +Imports iRacingSdkWrapper.Bitfields +Imports iRSDKSharp + +Public Class Form1 + + Private wrapper As SdkWrapper + + Public Sub New() + + ' This call is required by the designer. + InitializeComponent() + + ' Add any initialization after the InitializeComponent() call. + + ' Create a new instance of the SdkWrapper object + wrapper = New SdkWrapper() + + ' Tell it to raise events on the current thread (don't worry if you don't know what a thread is) + wrapper.EventRaiseType = SdkWrapper.EventRaiseTypes.CurrentThread + + ' Only update telemetry 10 times per second + wrapper.TelemetryUpdateFrequency = 10 + + ' Attach some useful events so you can respond when they get raised + AddHandler wrapper.Connected, AddressOf wrapper_Connected + AddHandler wrapper.Disconnected, AddressOf wrapper_Disconnected + AddHandler wrapper.SessionInfoUpdated, AddressOf wrapper_SessionInfoUpdated + AddHandler wrapper.TelemetryUpdated, AddressOf wrapper_TelemetryUpdated + End Sub + + Private Sub startButton_Click(sender As System.Object, e As System.EventArgs) Handles startButton.Click + ' If the wrapper is running, stop it. Otherwise, start it. + If wrapper.IsRunning Then + wrapper.Stop() + startButton.Text = "Start" + Else + wrapper.Start() + startButton.Text = "Stop" + End If + + Me.StatusChanged() + End Sub + + Private Sub StatusChanged() + If wrapper.IsConnected Then + If wrapper.IsRunning Then + statusLabel.Text = "Status: connected!" + Else + statusLabel.Text = "Status: disconnected." + End If + Else + If wrapper.IsRunning Then + statusLabel.Text = "Status: disconnected, waiting for sim..." + Else + statusLabel.Text = "Status: disconnected." + End If + End If + End Sub + + ' Event handler called when the sdk wrapper connects (eg, you start it, or the sim is started) + Private Sub wrapper_Connected(ByVal sender As Object, ByVal e As EventArgs) + Me.StatusChanged() + End Sub + + ' Event handler called when the sdk wrapper disconnects (eg, the sim closes) + Private Sub wrapper_Disconnected(ByVal sender As Object, ByVal e As EventArgs) + Me.StatusChanged() + End Sub + + ' Event handler called when the session info is updated + ' This typically happens when a car crosses the finish line for example + Private Sub wrapper_SessionInfoUpdated(ByVal sender As Object, ByVal e As SdkWrapper.SessionInfoUpdatedEventArgs) + sessionInfoLabel.Text = String.Format("Session info (last update time: {0})", e.UpdateTime) + + ' Let's just dump the session info: + sessionInfoTextBox.Text = e.SessionInfo.Yaml + + ' Read some YAML values using a YAML query + Dim trackName As String = e.SessionInfo.GetValue("WeekendInfo:TrackName:") + Dim sessionId As Integer = Integer.Parse(e.SessionInfo.GetValue("WeekendInfo:SessionId:")) + Dim windSpeed As String = e.SessionInfo.GetValue("WeekendInfo:WeekendOptions:WindSpeed:") + + ' Read some values with the easier notation (no need to write the yaml query) + Dim trackLength = e.SessionInfo("WeekendInfo")("TrackLength").GetValue() + Dim driver1Name = e.SessionInfo("DriverInfo")("Drivers")("CarIdx", "1")("UserName").GetValue() + + ' Attempt to read the username of a random driver safely + Dim random = New Random() + Dim id = random.Next(0, 60) + + Dim driverName As String + If e.SessionInfo("DriverInfo")("Drivers")("CarIdx", CStr(id))("UserName").TryGetValue(driverName) Then + ' Success + MessageBox.Show(driverName) + Else + ' not found + MessageBox.Show("Error retrieving name of driver " & id) + End If + + End Sub + + ' Event handler called when the telemetry is updated + ' This happens (max) 60 times per second + Private Sub wrapper_TelemetryUpdated(ByVal sender As Object, ByVal e As SdkWrapper.TelemetryUpdatedEventArgs) + telemetryLabel.Text = String.Format("Telemetry (last updated {0})", DateTime.Now.TimeOfDay.ToString()) + + ' Let's just write some random values: + Dim sb As New StringBuilder() + + Me.TelemetryExample(sb, e) + Me.ArrayExample(sb, e) + Me.BitfieldsExample(sb, e) + + ' Get a (fictional) value that is not covered in the TelemetryInfo properties + Dim fictionalObject = wrapper.GetTelemetryValue(Of Integer)("VariableName") + Dim fictionalValue = fictionalObject.Value + + telemetryTextBox.Text = sb.ToString() + End Sub + +#Region " Simple telemetry examples " + + ' Example method that adds speed and roll values to the string builder + Private Sub TelemetryExample(sb As StringBuilder, e As SdkWrapper.TelemetryUpdatedEventArgs) + ' Important distinction: TelemetryInfo.Speed (for example) returns an object of type TelemetryValue. + ' This object contains more than just the value; also the unit, name and a description. + ' To get just the value, you use the Value property. + ' This goes for every property of the TelemetryInfo class. + + sb.AppendLine("Speed: " & e.TelemetryInfo.Speed.Value) ' Without unit + sb.AppendLine("Speed: " & e.TelemetryInfo.Speed.ToString()) ' With unit + sb.AppendLine("Roll: " & e.TelemetryInfo.Roll.ToString()) + End Sub + + ' Example method that adds some data such as your lap distance and track surface to the string builder + Private Sub ArrayExample(sb As StringBuilder, e As SdkWrapper.TelemetryUpdatedEventArgs) + ' Get your own CarIdx + Dim myId As Integer = wrapper.DriverId + + ' Get the arrays you want + Dim lapDistances As Single() = e.TelemetryInfo.CarIdxLapDistPct.Value + Dim surfaces As TrackSurfaces() = e.TelemetryInfo.CarIdxTrackSurface.Value + + ' Your data is at your id index: + Dim myLapDistance As Single = lapDistances(myId) + Dim mySurface As TrackSurfaces = surfaces(myId) + + sb.AppendLine("My lap distance: " & myLapDistance) + sb.AppendLine("My track surface: " & mySurface.ToString()) + End Sub + + ' Example method that adds some caution flags to the string builder if they are displayed in the sim + Private Sub BitfieldsExample(sb As StringBuilder, e As SdkWrapper.TelemetryUpdatedEventArgs) + ' The value of SessionFlags returns a SessionFlag object which contains information about all currently active flags + ' Use the Contains method to check if it contains a specific flag. + ' + ' EngineWarnings and CameraStates behave similarly. + + Dim flags As SessionFlag = e.TelemetryInfo.SessionFlags.Value + If flags.Contains(SessionFlags.Black) Then + sb.AppendLine("Black flag!") + End If + If flags.Contains(SessionFlags.Disqualify) Then + sb.AppendLine("DQ") + End If + If flags.Contains(SessionFlags.Repair) Then + sb.AppendLine("Repair") + End If + If flags.Contains(SessionFlags.Checkered) Then + sb.AppendLine("Checkered") + End If + End Sub + +#End Region + + Private Sub Form1_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing + wrapper.Stop() + End Sub +End Class diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Application.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Application.Designer.vb new file mode 100644 index 0000000..31f2881 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.269 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.iRacingSdkWrapper.Examples.SimpleVB.Form1 + End Sub + End Class +End Namespace diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Application.myapp b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Application.myapp new file mode 100644 index 0000000..1243847 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + Form1 + false + 0 + true + 0 + 0 + true + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/AssemblyInfo.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..0063b42 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Resources.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Resources.Designer.vb new file mode 100644 index 0000000..45f6723 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.269 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("iRacingSdkWrapper.Examples.SimpleVB.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Settings.Designer.vb b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Settings.Designer.vb new file mode 100644 index 0000000..ffef8f0 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.269 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.iRacingSdkWrapper.Examples.SimpleVB.My.MySettings + Get + Return Global.iRacingSdkWrapper.Examples.SimpleVB.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/iRacingSdkWrapper.Examples.SimpleVB.vbproj b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/iRacingSdkWrapper.Examples.SimpleVB.vbproj new file mode 100644 index 0000000..cd40b48 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.SimpleVB/iRacingSdkWrapper.Examples.SimpleVB.vbproj @@ -0,0 +1,138 @@ + + + + Debug + x86 + + + 2.0 + {B951AFDD-9AD2-42C6-856D-E69CFBBBBA66} + WinExe + iRacingSdkWrapper.Examples.SimpleVB.My.MyApplication + iRacingSdkWrapper.Examples.SimpleVB + iRacingSdkWrapper.Examples.SimpleVB + 512 + WindowsForms + v4.0 + Client + + + x86 + true + full + true + true + bin\Debug\ + iRacingSdkWrapper.Examples.SimpleVB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + x86 + pdbonly + false + true + true + bin\Release\ + iRacingSdkWrapper.Examples.SimpleVB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + On + + + On + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + Form1.vb + Form + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + Form1.vb + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247} + iRacingSdkWrapper + + + {72631B85-EB9A-473E-9B4C-65B355A9000D} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/CustomSessionInfo.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/CustomSessionInfo.cs new file mode 100644 index 0000000..8f2d332 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/CustomSessionInfo.cs @@ -0,0 +1,36 @@ +using System.Collections.Generic; + +namespace iRacingSdkWrapper.Examples.YamlDeserialize +{ + public class CustomSessionInfo + { + public WeekendInfo WeekendInfo { get; set; } + public DriverInfo DriverInfo { get; set; } + } + + public class WeekendInfo + { + public string TrackName { get; set; } + public int TrackID { get; set; } + + public WeekendOptions WeekendOptions { get; set; } + } + + public class WeekendOptions + { + public int NumStarters { get; set; } + public string StartingGrid { get; set; } + } + + public class DriverInfo + { + public int DriverCarIdx { get; set; } + public List Drivers { get; set; } + } + + public class Driver + { + public int CarIdx { get; set; } + public string UserName { get; set; } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.Designer.cs new file mode 100644 index 0000000..f87374f --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.Designer.cs @@ -0,0 +1,62 @@ +namespace iRacingSdkWrapper.Examples.YamlDeserialize +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(46, 17); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(426, 212); + this.Controls.Add(this.label1); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + + } +} + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.cs new file mode 100644 index 0000000..d701123 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.cs @@ -0,0 +1,42 @@ +using System.IO; +using System.Windows.Forms; +using YamlDotNet.Serialization; + +namespace iRacingSdkWrapper.Examples.YamlDeserialize +{ + public partial class Form1 : Form + { + private SdkWrapper wrapper; + + public Form1() + { + InitializeComponent(); + + wrapper = new SdkWrapper(); + wrapper.SessionInfoUpdated += wrapper_SessionInfoUpdated; + wrapper.Start(); + } + + private void wrapper_SessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + // Create a Deserializer + // Tell it to ignore unmatched properties unless you have mapped every single property + var deserializer = new Deserializer(ignoreUnmatched: true); + + // Read the session info yaml + using (var reader = new StringReader(e.SessionInfo.Yaml)) + { + var customSessionInfo = deserializer.Deserialize(reader); + + // Write it to a label for example + label1.Text = "WeekendInfo:TrackName: " + customSessionInfo.WeekendInfo.TrackName + + "\n" + + "WeekendInfo:WeekendOptions:StartingGrid: " + + customSessionInfo.WeekendInfo.WeekendOptions.StartingGrid + + "\n" + + "DriverInfo:Drivers[0]:UserName: " + customSessionInfo.DriverInfo.Drivers[0].UserName; + } + } + + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Program.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Program.cs new file mode 100644 index 0000000..0e9b980 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Forms; +using iRacingSdkWrapper.Examples.YamlDeserialize; + +namespace iRacingSdkWrapper.Examples.YamlStream +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2078d29 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSdkWrapper.Examples.YamlStream")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSdkWrapper.Examples.YamlStream")] +[assembly: AssemblyCopyright("Copyright © 2014")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3adb815a-3900-4ff9-ab57-f486541a6348")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Resources.Designer.cs new file mode 100644 index 0000000..1bc6724 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.YamlDeserialize.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSdkWrapper.Examples.YamlDeserialize.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Settings.Designer.cs new file mode 100644 index 0000000..615133a --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18444 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSdkWrapper.Examples.YamlDeserialize.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/iRacingSdkWrapper.Examples.YamlDeserialize.csproj b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/iRacingSdkWrapper.Examples.YamlDeserialize.csproj new file mode 100644 index 0000000..b0ffb10 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/iRacingSdkWrapper.Examples.YamlDeserialize.csproj @@ -0,0 +1,101 @@ + + + + + Debug + AnyCPU + {4FBC7604-C0C6-435B-99A9-30F3CC7A1BCE} + WinExe + Properties + iRacingSdkWrapper.Examples.YamlDeserialize + iRacingSdkWrapper.Examples.YamlDeserialize + v4.0 + 512 + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + ..\packages\YamlDotNet.3.2.1\lib\net35\YamlDotNet.dll + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + {72631b85-eb9a-473e-9b4c-65b355a9000d} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/packages.config b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/packages.config new file mode 100644 index 0000000..3296952 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSdkWrapper.Examples.YamlDeserialize/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.config b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.config new file mode 100644 index 0000000..9c05822 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.xaml b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.xaml new file mode 100644 index 0000000..944e285 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.xaml.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.xaml.cs new file mode 100644 index 0000000..fab0990 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace iRacingSimulator.Examples.IncidentLog +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Incident.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Incident.cs new file mode 100644 index 0000000..2ce27a6 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Incident.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using iRacingSimulator.Drivers; + +namespace iRacingSimulator.Examples.IncidentLog +{ + public class Incident + { + public Incident(Driver driver, string sessionType, double sessionTime, int delta) + { + this.SessionType = sessionType; + this.SessionTime = sessionTime; + this.TimeDisplay = TimeSpan.FromSeconds(sessionTime).ToString(@"hh\:mm\:ss"); + this.Driver = driver; + this.DriverDisplay = driver.LongDisplay; + this.IncDelta = delta; + } + + public string SessionType { get; set; } + + public double SessionTime { get; set; } + public string TimeDisplay { get; set; } + + public Driver Driver { get; set; } + public string DriverDisplay { get; set; } + + public int IncDelta { get; set; } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/MainWindow.xaml b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/MainWindow.xaml new file mode 100644 index 0000000..44b0bce --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/MainWindow.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/MainWindow.xaml.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/MainWindow.xaml.cs new file mode 100644 index 0000000..266fd7f --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/MainWindow.xaml.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using iRacingSdkWrapper; +using iRacingSimulator.Drivers; +using Path = System.IO.Path; + +namespace iRacingSimulator.Examples.IncidentLog +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + private readonly ObservableCollection _drivers; + private readonly ObservableCollection _incidents; + private readonly ICollectionView _driversView, _incidentsView; + + public MainWindow() + { + InitializeComponent(); + + _drivers = new ObservableCollection(); + _incidents = new ObservableCollection(); + _driversView = CollectionViewSource.GetDefaultView(_drivers); + _incidentsView = CollectionViewSource.GetDefaultView(_incidents); + + driversGrid.ItemsSource = _driversView; + incsGrid.ItemsSource = _incidentsView; + + _driversView.SortDescriptions.Add(new SortDescription("CarNumber", ListSortDirection.Ascending)); + _incidentsView.SortDescriptions.Add(new SortDescription("SessionTime", ListSortDirection.Descending)); + + Sim.Instance.SessionInfoUpdated += OnSessionInfoUpdated; + Sim.Instance.Start(); + } + + private void OnSessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + UpdateIncidents(e); + SaveSessionInfo(e); + } + + private void UpdateIncidents(SdkWrapper.SessionInfoUpdatedEventArgs e) + { + var type = Sim.Instance.SessionData.SessionType[0].ToString(); + var time = e.UpdateTime; + + var oldDict = _drivers.ToDictionary(driver => driver.Id); + var newDict = Sim.Instance.Drivers.ToDictionary(driver => driver.Id); + + _drivers.Clear(); + + foreach (var kvp in newDict) + { + var id = kvp.Key; + var driver = kvp.Value; + + var prevInc = 0; + if (oldDict.ContainsKey(id)) + { + prevInc = oldDict[id].CurrentResults.Incidents; + } + + var delta = driver.CurrentResults.Incidents - prevInc; + if (delta > 0) + { + _incidents.Add(new Incident(driver, type, time, delta)); + } + + _drivers.Add(driver); + } + } + + private void SaveSessionInfo(SdkWrapper.SessionInfoUpdatedEventArgs e) + { + var dir = "output"; + if (!Directory.Exists(dir)) Directory.CreateDirectory(dir); + + var path = Path.Combine(dir, $"sessioninfo_{e.UpdateTime.ToString("0")}.txt"); + File.WriteAllText(path, e.SessionInfo.Yaml); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..717ce1b --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSimulator.Examples.IncidentLog")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSimulator.Examples.IncidentLog")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e9cb85b --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.IncidentLog.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSimulator.Examples.IncidentLog.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Settings.Designer.cs new file mode 100644 index 0000000..3a717d2 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.IncidentLog.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/iRacingSimulator.Examples.IncidentLog.csproj b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/iRacingSimulator.Examples.IncidentLog.csproj new file mode 100644 index 0000000..85a95a4 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.IncidentLog/iRacingSimulator.Examples.IncidentLog.csproj @@ -0,0 +1,117 @@ + + + + + Debug + AnyCPU + {991ED105-83E9-47C4-BF23-C4C99EACACEA} + WinExe + Properties + iRacingSimulator.Examples.IncidentLog + iRacingSimulator.Examples.IncidentLog + v4.5.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247} + iRacingSdkWrapper + + + {1765E7DB-BEE4-4324-A396-923D80B61EA0} + iRacingSimulator + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.config b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.config new file mode 100644 index 0000000..9c05822 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.xaml b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.xaml new file mode 100644 index 0000000..6397f70 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.xaml.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.xaml.cs new file mode 100644 index 0000000..adb63be --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/App.xaml.cs @@ -0,0 +1,67 @@ +using iRacingSimulator.Examples.WPF_MVVM_DriverGrid.ViewModels; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace iRacingSimulator.Examples.WPF_MVVM_DriverGrid +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + private List _sdkViewModels; + + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + + _sdkViewModels = new List(); + + // Connect viewmodel and view + var model = new MainViewModel(); + var view = new MainWindow(); + view.DataContext = model; + + // Register viewmodel + this.RegisterSdkViewModel(model); + + // Setup sim communication + Sim.Instance.SessionInfoUpdated += OnSessionInfoUpdated; + Sim.Instance.TelemetryUpdated += OnTelemetryUpdated; + Sim.Instance.Start(); + + view.Show(); + } + + private void OnSessionInfoUpdated(object sender, iRacingSdkWrapper.SdkWrapper.SessionInfoUpdatedEventArgs e) + { + foreach (var model in _sdkViewModels) + { + model.OnSessionInfoUpdated(e.SessionInfo, e.UpdateTime); + } + } + + private void OnTelemetryUpdated(object sender, iRacingSdkWrapper.SdkWrapper.TelemetryUpdatedEventArgs e) + { + foreach (var model in _sdkViewModels) + { + model.OnTelemetryUpdated(e.TelemetryInfo, e.UpdateTime); + } + } + + private void RegisterSdkViewModel(SdkViewModel model) + { + _sdkViewModels.Add(model); + } + + private void UnregisterSdkViewModel(SdkViewModel model) + { + _sdkViewModels.Remove(model); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/MainWindow.xaml b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/MainWindow.xaml new file mode 100644 index 0000000..6672468 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/MainWindow.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/MainWindow.xaml.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/MainWindow.xaml.cs new file mode 100644 index 0000000..2203012 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/MainWindow.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace iRacingSimulator.Examples.WPF_MVVM_DriverGrid +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e0b6555 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSimulator.Examples.WPF-MVVM-DriverGrid")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSimulator.Examples.WPF-MVVM-DriverGrid")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Resources.Designer.cs new file mode 100644 index 0000000..95e8c46 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WPF_MVVM_DriverGrid.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSimulator.Examples.WPF_MVVM_DriverGrid.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Settings.Designer.cs new file mode 100644 index 0000000..40323b6 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WPF_MVVM_DriverGrid.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/ViewModels/MainViewModel.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..9a33025 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/ViewModels/MainViewModel.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using iRacingSdkWrapper; +using System.ComponentModel; +using System.Collections.ObjectModel; +using iRacingSimulator.Drivers; +using System.Windows.Data; + +namespace iRacingSimulator.Examples.WPF_MVVM_DriverGrid.ViewModels +{ + public class MainViewModel : SdkViewModel + { + private readonly ObservableCollection _drivers; + public ObservableCollection Drivers { get { return _drivers; } } + + private readonly ICollectionView _driversView; + public ICollectionView DriversView { get { return _driversView; } } + + public MainViewModel() + { + _drivers = new ObservableCollection(); + _driversView = CollectionViewSource.GetDefaultView(_drivers); + } + + public override void OnSessionInfoUpdated(SessionInfo info, double updateTime) + { + _drivers.Clear(); + + // Perhaps should add some locking to prevent entering this loop twice when session info updates very quickly + foreach (var driver in Sim.Instance.Drivers) + { + _drivers.Add(driver); + } + } + + private double _lastUpdate; + + public override void OnTelemetryUpdated(TelemetryInfo info, double updateTime) + { + if (updateTime - _lastUpdate > 1) + { + _driversView.Refresh(); + _lastUpdate = updateTime; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/ViewModels/SdkViewModel.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/ViewModels/SdkViewModel.cs new file mode 100644 index 0000000..0b368c8 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/ViewModels/SdkViewModel.cs @@ -0,0 +1,26 @@ +using iRacingSdkWrapper; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using iRacingSimulator.Examples.WPF_MVVM_DriverGrid.Annotations; + +namespace iRacingSimulator.Examples.WPF_MVVM_DriverGrid.ViewModels +{ + public abstract class SdkViewModel : INotifyPropertyChanged + { + public abstract void OnSessionInfoUpdated(SessionInfo info, double updateTime); + public abstract void OnTelemetryUpdated(TelemetryInfo info, double updateTime); + public event PropertyChangedEventHandler PropertyChanged; + + [NotifyPropertyChangedInvocator] + protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) + { + var handler = PropertyChanged; + if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/iRacingSimulator.Examples.WPF-MVVM-DriverGrid.csproj b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/iRacingSimulator.Examples.WPF-MVVM-DriverGrid.csproj new file mode 100644 index 0000000..ea63458 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPF-MVVM-DriverGrid/iRacingSimulator.Examples.WPF-MVVM-DriverGrid.csproj @@ -0,0 +1,119 @@ + + + + + Debug + AnyCPU + {34F020F4-F320-4C65-9EC0-F2939AD9D7CB} + WinExe + Properties + iRacingSimulator.Examples.WPF_MVVM_DriverGrid + iRacingSimulator.Examples.WPF-MVVM-DriverGrid + v4.5.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + {1765e7db-bee4-4324-a396-923d80b61ea0} + iRacingSimulator + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.config b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.config new file mode 100644 index 0000000..9c05822 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.xaml b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.xaml new file mode 100644 index 0000000..1d990c7 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.xaml.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.xaml.cs new file mode 100644 index 0000000..7209ab7 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace iRacingSimulator.Examples.WPFDriverGrid +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/MainWindow.xaml b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/MainWindow.xaml new file mode 100644 index 0000000..a03d579 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/MainWindow.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/MainWindow.xaml.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/MainWindow.xaml.cs new file mode 100644 index 0000000..56a68ff --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/MainWindow.xaml.cs @@ -0,0 +1,95 @@ +using iRacingSimulator.Drivers; +using System; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using iRacingSimulator.Events; + +namespace iRacingSimulator.Examples.WPFDriverGrid +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + private ObservableCollection _drivers; + private ICollectionView _view; + + public MainWindow() + { + InitializeComponent(); + + // Initialize the grid + this.SetupGrid(); + + // Initialize the sim communication + Sim.Instance.SessionInfoUpdated += OnSessionInfoUpdated; + Sim.Instance.TelemetryUpdated += OnTelemetryUpdated; + Sim.Instance.RaceEvent += OnRaceEvent; + Sim.Instance.Start(); + } + + private void SetupGrid() + { + // Create a new observable collection of drivers + _drivers = new ObservableCollection(); + + // Create a new collectionview to bind to the grid + _view = CollectionViewSource.GetDefaultView(_drivers); + + // Bind it to the grid + grid.ItemsSource = _view; + } + + private void RefreshGrid() + { + // Might not be necessary at all due to use of ObservableCollection which automatically notifies grid of changes + _view.Refresh(); + } + + private void OnSessionInfoUpdated(object sender, iRacingSdkWrapper.SdkWrapper.SessionInfoUpdatedEventArgs e) + { + // Update the list of drivers: simply clear the old list and re-fill it with the drivers from iRacingSimulator + _drivers.Clear(); + + // ObservableCollection does not support AddRange so we just call Add in a loop + // Note: this is probably not a good idea as it notifies the grid of updates for every driver, rather than just once + foreach (var driver in Sim.Instance.Drivers) + { + _drivers.Add(driver); + } + + // Update the grid + this.RefreshGrid(); + } + + private void OnTelemetryUpdated(object sender, iRacingSdkWrapper.SdkWrapper.TelemetryUpdatedEventArgs e) + { + // No need to do anything here in this example, but you can access all telemetry: + double sessionTime = e.TelemetryInfo.SessionTime.Value; + + this.RefreshGrid(); + } + + private void OnRaceEvent(object sender, Sim.RaceEventArgs e) + { + if (e.Event.Type == RaceEvent.EventTypes.DriverSwap) + { + var swapEvent = (DriverSwapRaceEvent)e.Event; + MessageBox.Show(string.Format("Driver {0} replaced driver {1}.", swapEvent.PreviousDriverName, swapEvent.CurrentDriverName)); + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..adb340f --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSimulator.Examples.WPFDriverGrid")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSimulator.Examples.WPFDriverGrid")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +//In order to begin building localizable applications, set +//CultureYouAreCodingWith in your .csproj file +//inside a . For example, if you are using US english +//in your source files, set the to en-US. Then uncomment +//the NeutralResourceLanguage attribute below. Update the "en-US" in +//the line below to match the UICulture setting in the project file. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] + + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Resources.Designer.cs new file mode 100644 index 0000000..7a0bb29 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WPFDriverGrid.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSimulator.Examples.WPFDriverGrid.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Settings.Designer.cs new file mode 100644 index 0000000..be6958e --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WPFDriverGrid.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Settings.settings new file mode 100644 index 0000000..033d7a5 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/iRacingSimulator.Examples.WPFDriverGrid.csproj b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/iRacingSimulator.Examples.WPFDriverGrid.csproj new file mode 100644 index 0000000..37c3b73 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WPFDriverGrid/iRacingSimulator.Examples.WPFDriverGrid.csproj @@ -0,0 +1,116 @@ + + + + + Debug + AnyCPU + {B36991C5-2B13-4487-B42B-FA1EE0A7721F} + WinExe + Properties + iRacingSimulator.Examples.WPFDriverGrid + iRacingSimulator.Examples.WPFDriverGrid + v4.5.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + {1765e7db-bee4-4324-a396-923d80b61ea0} + iRacingSimulator + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/App.config b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/App.config new file mode 100644 index 0000000..9c05822 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.Designer.cs new file mode 100644 index 0000000..59a517a --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.Designer.cs @@ -0,0 +1,62 @@ +namespace iRacingSimulator.Examples.WinformsDriverGrid +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // dataGridView1 + // + this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.Location = new System.Drawing.Point(0, 0); + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.Size = new System.Drawing.Size(767, 484); + this.dataGridView1.TabIndex = 0; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(767, 484); + this.Controls.Add(this.dataGridView1); + this.Name = "Form1"; + this.Text = "Form1"; + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView1; + } +} + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.cs new file mode 100644 index 0000000..1043f15 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.cs @@ -0,0 +1,110 @@ +using iRacingSimulator.Drivers; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using iRacingSimulator.Events; + +namespace iRacingSimulator.Examples.WinformsDriverGrid +{ + public partial class Form1 : Form + { + private List _drivers; + private BindingSource _source; + + public Form1() + { + InitializeComponent(); + + // Initialize the grid + this.SetupGrid(); + + // Initialize the sim communication + Sim.Instance.SessionInfoUpdated += OnSessionInfoUpdated; + Sim.Instance.TelemetryUpdated += OnTelemetryUpdated; + Sim.Instance.RaceEvent += OnRaceEvent; + Sim.Instance.Start(); + } + + private void SetupGrid() + { + // Create a new list to hold the drivers + _drivers = new List(); + + // Create a new binding source and bind the list of drivers + _source = new BindingSource(); + _source.DataSource = _drivers; + + // We will set our own columns + dataGridView1.AutoGenerateColumns = false; + + // Bind it to the grid + dataGridView1.DataSource = _source; + + // Setup the columns + // Note: winforms datagrid cannot simply show nested properties (such as Driver.Live.Position) hence I'm omitting those. + // Look at WPF example for a better grid + var col = new DataGridViewTextBoxColumn(); + col.DataPropertyName = "Custid"; + col.HeaderText = "Customer ID"; + col.Name = "colCustid"; + dataGridView1.Columns.Add(col); + + col = new DataGridViewTextBoxColumn(); + col.DataPropertyName = "Name"; + col.HeaderText = "Name"; + col.Name = "colName"; + dataGridView1.Columns.Add(col); + + col = new DataGridViewTextBoxColumn(); + col.DataPropertyName = "CarNumber"; + col.HeaderText = "Car #"; + col.Name = "colCarnumber"; + dataGridView1.Columns.Add(col); + + col = new DataGridViewTextBoxColumn(); + col.DataPropertyName = "IRating"; + col.HeaderText = "iRating"; + col.Name = "colIRating"; + dataGridView1.Columns.Add(col); + } + + private void RefreshGrid() + { + // Refresh the grid by resetting the binding source + // (There are probably better ways to do this, this will lose selection and scroll position etc) + _source.ResetBindings(false); + } + + private void OnSessionInfoUpdated(object sender, iRacingSdkWrapper.SdkWrapper.SessionInfoUpdatedEventArgs e) + { + // Update the list of drivers: simply clear the old list and re-fill it with the drivers from iRacingSimulator + _drivers.Clear(); + _drivers.AddRange(Sim.Instance.Drivers); + + // Update the grid + this.RefreshGrid(); + } + + private void OnTelemetryUpdated(object sender, iRacingSdkWrapper.SdkWrapper.TelemetryUpdatedEventArgs e) + { + // No need to do anything here in this example, but you can access all telemetry: + double sessionTime = e.TelemetryInfo.SessionTime.Value; + } + + private void OnRaceEvent(object sender, Sim.RaceEventArgs e) + { + if (e.Event.Type == RaceEvent.EventTypes.DriverSwap) + { + var swapEvent = (DriverSwapRaceEvent) e.Event; + MessageBox.Show(string.Format("Driver {0} replaced driver {1}.", swapEvent.PreviousDriverName, swapEvent.CurrentDriverName)); + } + } + + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Program.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Program.cs new file mode 100644 index 0000000..d62c37c --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace iRacingSimulator.Examples.WinformsDriverGrid +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4a93bc1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSimulator.Examples.WinformsDriverGrid")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSimulator.Examples.WinformsDriverGrid")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bbb48cba-25ac-4d1a-a2e4-f9ba04edf23e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Resources.Designer.cs new file mode 100644 index 0000000..788015f --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WinformsDriverGrid.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSimulator.Examples.WinformsDriverGrid.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Settings.Designer.cs new file mode 100644 index 0000000..96e3323 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WinformsDriverGrid.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/iRacingSimulator.Examples.WinformsDriverGrid.csproj b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/iRacingSimulator.Examples.WinformsDriverGrid.csproj new file mode 100644 index 0000000..84a99ff --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsDriverGrid/iRacingSimulator.Examples.WinformsDriverGrid.csproj @@ -0,0 +1,100 @@ + + + + + Debug + AnyCPU + {BBB48CBA-25AC-4D1A-A2E4-F9BA04EDF23E} + WinExe + Properties + iRacingSimulator.Examples.WinformsDriverGrid + iRacingSimulator.Examples.WinformsDriverGrid + v4.5.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247} + iRacingSdkWrapper + + + {1765e7db-bee4-4324-a396-923d80b61ea0} + iRacingSimulator + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/App.config b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/App.config new file mode 100644 index 0000000..9c05822 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.Designer.cs new file mode 100644 index 0000000..d2d59b9 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.Designer.cs @@ -0,0 +1,116 @@ +namespace iRacingSimulator.Examples.WinformsLaptimeLogger +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.lblStatus = new System.Windows.Forms.Label(); + this.panel1 = new System.Windows.Forms.Panel(); + this.panel2 = new System.Windows.Forms.Panel(); + this.grid = new System.Windows.Forms.DataGridView(); + this.panel1.SuspendLayout(); + this.panel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.grid)).BeginInit(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 12); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(40, 13); + this.label1.TabIndex = 2; + this.label1.Text = "Status:"; + // + // lblStatus + // + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(58, 12); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(106, 13); + this.lblStatus.TabIndex = 3; + this.lblStatus.Text = "Waiting for iRacing..."; + // + // panel1 + // + this.panel1.Controls.Add(this.label1); + this.panel1.Controls.Add(this.lblStatus); + this.panel1.Dock = System.Windows.Forms.DockStyle.Top; + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(885, 41); + this.panel1.TabIndex = 4; + // + // panel2 + // + this.panel2.Controls.Add(this.grid); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 41); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(885, 448); + this.panel2.TabIndex = 5; + // + // grid + // + this.grid.AllowUserToAddRows = false; + this.grid.AllowUserToDeleteRows = false; + this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.grid.Dock = System.Windows.Forms.DockStyle.Fill; + this.grid.Location = new System.Drawing.Point(0, 0); + this.grid.Name = "grid"; + this.grid.ReadOnly = true; + this.grid.Size = new System.Drawing.Size(885, 448); + this.grid.TabIndex = 0; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(885, 489); + this.Controls.Add(this.panel2); + this.Controls.Add(this.panel1); + this.Name = "Form1"; + this.Text = "Form1"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + this.panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.grid)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.Panel panel2; + private System.Windows.Forms.DataGridView grid; + } +} + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.cs new file mode 100644 index 0000000..a2d7a15 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using iRacingSdkWrapper; + +namespace iRacingSimulator.Examples.WinformsLaptimeLogger +{ + public partial class Form1 : Form + { + // List of lap entries to show in the grid + private List laps; + + // BindingSource binds the list of laps to the grid + private BindingSource bindingSource; + + // A dictionary (key = driver CarIdx) of the lap number of each driver, + // so we can check if they have completed a new lap + private Dictionary previousLaps; + + public Form1() + { + InitializeComponent(); + + // Create the list of laps + laps = new List(); + + // Create the previous laps dictionary + previousLaps = new Dictionary(); + + // Create the binding source + bindingSource = new BindingSource(); + + // Bind the list to the grid + bindingSource.DataSource = laps; + grid.DataSource = bindingSource; + } + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + + // Listen for relevant events + Sim.Instance.Connected += OnSimConnected; + Sim.Instance.Disconnected += OnSimDisconnected; + Sim.Instance.SessionInfoUpdated += OnSessionInfoUpdated; + + // Start looking for iRacing. The update frequency is only 1 Hz because we don't really need any live telemetry. + Sim.Instance.Start(1); + } + + private void OnSimConnected(object sender, EventArgs eventArgs) + { + lblStatus.Text = "Connected!"; + } + + private void OnSimDisconnected(object sender, EventArgs eventArgs) + { + lblStatus.Text = "Waiting for iRacing..."; + } + + private void OnSessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + // The session info has updated + bool shouldUpdateGrid = false; + + // Let's check every driver for a new lap + foreach (var driver in Sim.Instance.Drivers) + { + // Ignore if there are no results yet + if (driver.CurrentResults == null) continue; + + // Get the number of laps this driver has completed + var currentLap = driver.CurrentResults.LapsComplete; + + // Check what lap this driver was on the last update + int? previousLap = null; + if (previousLaps.ContainsKey(driver.Id)) + { + // We already stored their previous lap + previousLap = previousLaps[driver.Id]; + + // Then update the lap number to the current lap + previousLaps[driver.Id] = currentLap; + } + else + { + // We didn't store their lap yet, so add it + previousLaps.Add(driver.Id, currentLap); + } + + // Check if their lap number has changed + if (previousLap == null || previousLap.Value < currentLap) + { + // Lap has changed, grab their laptime and add to the list of lap entries + var lastTime = driver.CurrentResults.LastTime; + + var entry = new LapEntry(); + entry.CustomerId = driver.CustId; + entry.Name = driver.Name; + entry.CarNumber = driver.CarNumber; + + entry.Lap = lastTime.LapNumber; + entry.Laptime = lastTime.Value; + entry.LaptimeDisplay = lastTime.Display; + + laps.Add(entry); + + // After we checked every driver we need to update the grid to reflect the changes + shouldUpdateGrid = true; + } + } + + if (shouldUpdateGrid) + { + bindingSource.ResetBindings(false); + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.resx b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/LapEntry.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/LapEntry.cs new file mode 100644 index 0000000..4abc6ed --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/LapEntry.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace iRacingSimulator.Examples.WinformsLaptimeLogger +{ + public class LapEntry + { + public int CustomerId { get; set; } + public string Name { get; set; } + public string CarNumber { get; set; } + public int Lap { get; set; } + public int Laptime { get; set; } + public string LaptimeDisplay { get; set; } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Program.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Program.cs new file mode 100644 index 0000000..355d1f6 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace iRacingSimulator.Examples.WinformsLaptimeLogger +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..3cf0358 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSimulator.Examples.WinformsLaptimeLogger")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSimulator.Examples.WinformsLaptimeLogger")] +[assembly: AssemblyCopyright("Copyright © 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f036bcc7-4918-4058-a790-1ea00c1d97c1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Resources.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Resources.Designer.cs new file mode 100644 index 0000000..16e3ffa --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WinformsLaptimeLogger.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("iRacingSimulator.Examples.WinformsLaptimeLogger.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Resources.resx b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Settings.Designer.cs b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Settings.Designer.cs new file mode 100644 index 0000000..0caa69e --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace iRacingSimulator.Examples.WinformsLaptimeLogger.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Settings.settings b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/iRacingSimulator.Examples.WinformsLaptimeLogger.csproj b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/iRacingSimulator.Examples.WinformsLaptimeLogger.csproj new file mode 100644 index 0000000..4c6d6b8 --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/iRacingSimulator.Examples.WinformsLaptimeLogger.csproj @@ -0,0 +1,105 @@ + + + + + Debug + AnyCPU + {F036BCC7-4918-4058-A790-1EA00C1D97C1} + WinExe + Properties + iRacingSimulator.Examples.WinformsLaptimeLogger + iRacingSimulator.Examples.WinformsLaptimeLogger + v4.5.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + {1765e7db-bee4-4324-a396-923d80b61ea0} + iRacingSimulator + + + {72631b85-eb9a-473e-9b4c-65b355a9000d} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/iRacingSimulator.Examples.WinformsLaptimeLogger.sln b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/iRacingSimulator.Examples.WinformsLaptimeLogger.sln new file mode 100644 index 0000000..54c7b9c --- /dev/null +++ b/iRacingSdkWrapper/Samples/iRacingSimulator.Examples.WinformsLaptimeLogger/iRacingSimulator.Examples.WinformsLaptimeLogger.sln @@ -0,0 +1,40 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSimulator.Examples.WinformsLaptimeLogger", "iRacingSimulator.Examples.WinformsLaptimeLogger.csproj", "{F036BCC7-4918-4058-A790-1EA00C1D97C1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSdkWrapper", "..\..\iRacingSdkWrapper\iRacingSdkWrapper.csproj", "{D6DB568B-35B3-49EB-8CB3-E4E5F1424247}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSimulator", "..\..\iRacingSimulator\iRacingSimulator.csproj", "{1765E7DB-BEE4-4324-A396-923D80B61EA0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRSDKSharp", "..\..\irsdkSharp\iRSDKSharp.csproj", "{72631B85-EB9A-473E-9B4C-65B355A9000D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F036BCC7-4918-4058-A790-1EA00C1D97C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F036BCC7-4918-4058-A790-1EA00C1D97C1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F036BCC7-4918-4058-A790-1EA00C1D97C1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F036BCC7-4918-4058-A790-1EA00C1D97C1}.Release|Any CPU.Build.0 = Release|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Release|Any CPU.Build.0 = Release|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Release|Any CPU.Build.0 = Release|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/iRacingSdkWrapper/iRacingSdkWrapper.sln b/iRacingSdkWrapper/iRacingSdkWrapper.sln new file mode 100644 index 0000000..79eb6eb --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper.sln @@ -0,0 +1,64 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25123.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSdkWrapper", "iRacingSdkWrapper\iRacingSdkWrapper.csproj", "{D6DB568B-35B3-49EB-8CB3-E4E5F1424247}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRSDKSharp", "irsdkSharp\iRSDKSharp.csproj", "{72631B85-EB9A-473E-9B4C-65B355A9000D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSimulator", "iRacingSimulator\iRacingSimulator.csproj", "{1765E7DB-BEE4-4324-A396-923D80B61EA0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSimulator.Examples.WinformsDriverGrid", "Samples\iRacingSimulator.Examples.WinformsDriverGrid\iRacingSimulator.Examples.WinformsDriverGrid.csproj", "{BBB48CBA-25AC-4D1A-A2E4-F9BA04EDF23E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSimulator.Examples.WPFDriverGrid", "Samples\iRacingSimulator.Examples.WPFDriverGrid\iRacingSimulator.Examples.WPFDriverGrid.csproj", "{B36991C5-2B13-4487-B42B-FA1EE0A7721F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSimulator.Examples.WPF-MVVM-DriverGrid", "Samples\iRacingSimulator.Examples.WPF-MVVM-DriverGrid\iRacingSimulator.Examples.WPF-MVVM-DriverGrid.csproj", "{34F020F4-F320-4C65-9EC0-F2939AD9D7CB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSdkWrapper.Examples.BroadcastMessages", "Samples\iRacingSdkWrapper.Examples.BroadcastMessages\iRacingSdkWrapper.Examples.BroadcastMessages.csproj", "{426199FD-4CB6-4AB8-8B42-053368F49416}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "iRacingSimulator.Examples.IncidentLog", "Samples\iRacingSimulator.Examples.IncidentLog\iRacingSimulator.Examples.IncidentLog.csproj", "{991ED105-83E9-47C4-BF23-C4C99EACACEA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247}.Release|Any CPU.Build.0 = Release|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72631B85-EB9A-473E-9B4C-65B355A9000D}.Release|Any CPU.Build.0 = Release|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0}.Release|Any CPU.Build.0 = Release|Any CPU + {BBB48CBA-25AC-4D1A-A2E4-F9BA04EDF23E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BBB48CBA-25AC-4D1A-A2E4-F9BA04EDF23E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BBB48CBA-25AC-4D1A-A2E4-F9BA04EDF23E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BBB48CBA-25AC-4D1A-A2E4-F9BA04EDF23E}.Release|Any CPU.Build.0 = Release|Any CPU + {B36991C5-2B13-4487-B42B-FA1EE0A7721F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B36991C5-2B13-4487-B42B-FA1EE0A7721F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B36991C5-2B13-4487-B42B-FA1EE0A7721F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B36991C5-2B13-4487-B42B-FA1EE0A7721F}.Release|Any CPU.Build.0 = Release|Any CPU + {34F020F4-F320-4C65-9EC0-F2939AD9D7CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {34F020F4-F320-4C65-9EC0-F2939AD9D7CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {34F020F4-F320-4C65-9EC0-F2939AD9D7CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {34F020F4-F320-4C65-9EC0-F2939AD9D7CB}.Release|Any CPU.Build.0 = Release|Any CPU + {426199FD-4CB6-4AB8-8B42-053368F49416}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {426199FD-4CB6-4AB8-8B42-053368F49416}.Debug|Any CPU.Build.0 = Debug|Any CPU + {426199FD-4CB6-4AB8-8B42-053368F49416}.Release|Any CPU.ActiveCfg = Release|Any CPU + {426199FD-4CB6-4AB8-8B42-053368F49416}.Release|Any CPU.Build.0 = Release|Any CPU + {991ED105-83E9-47C4-BF23-C4C99EACACEA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {991ED105-83E9-47C4-BF23-C4C99EACACEA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {991ED105-83E9-47C4-BF23-C4C99EACACEA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {991ED105-83E9-47C4-BF23-C4C99EACACEA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/iRacingSdkWrapper/iRacingSdkWrapper.sln.DotSettings b/iRacingSdkWrapper/iRacingSdkWrapper.sln.DotSettings new file mode 100644 index 0000000..55c34bd --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper.sln.DotSettings @@ -0,0 +1,2 @@ + + True \ No newline at end of file diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/BitfieldBase.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/BitfieldBase.cs new file mode 100644 index 0000000..4152abe --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/BitfieldBase.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace iRacingSdkWrapper.Bitfields +{ + public abstract class BitfieldBase + where T : struct, IConvertible, IComparable + { + protected BitfieldBase() : this(0) + { } + + protected BitfieldBase(int value) + { + _value = (uint)value; + } + + private uint _value; + public uint Value { get { return _value; } } + + public void Add(T bit) + { + if (!Contains(bit)) + _value = _value | (uint)Convert.ChangeType(bit, bit.GetTypeCode()); + } + + public void Remove(T bit) + { + if (Contains(bit)) + _value = _value & ~(uint)Convert.ChangeType(bit, bit.GetTypeCode()); + } + + public bool Contains(T bit) + { + var bitValue = (uint) Convert.ChangeType(bit, bit.GetTypeCode()); + return (this.Value & bitValue) == bitValue; + } + + public override string ToString() + { + var values = new List(); + foreach (var value in Enum.GetValues(typeof (T))) + { + if (this.Contains((T) value)) + { + values.Add((T)value); + } + } + return string.Join(" | ", values.Select(v => v.ToString())); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/CameraState.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/CameraState.cs new file mode 100644 index 0000000..d2b9886 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/CameraState.cs @@ -0,0 +1,28 @@ +using System; +using System.Text; + +namespace iRacingSdkWrapper.Bitfields +{ + public class CameraState : BitfieldBase + { + public CameraState() : this(0) { } + + public CameraState(int value) : base(value) + { + } + } + + [Flags] + public enum CameraStates : uint + { + IsSessionScreen = 0x0001, // the camera tool can only be activated if viewing the session screen (out of car) + IsScenicActive = 0x0002, // the scenic camera is active (no focus car) + CamToolActive = 0x0004, + UIHidden = 0x0008, + UseAutoShotSelection = 0x0010, + UseTemporaryEdits = 0x0020, + UseKeyAcceleration = 0x0040, + UseKey10xAcceleration = 0x0080, + UseMouseAimMode = 0x0100 + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/EngineWarning.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/EngineWarning.cs new file mode 100644 index 0000000..2ed584d --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/EngineWarning.cs @@ -0,0 +1,23 @@ +using System; + +namespace iRacingSdkWrapper.Bitfields +{ + public class EngineWarning : BitfieldBase + { + public EngineWarning(int value) + : base(value) + { + } + } + + [Flags] + public enum EngineWarnings : uint + { + WaterTemperatureWarning = 0x01, + FuelPressureWarning = 0x02, + OilPressureWarning = 0x04, + EngineStalled = 0x08, + PitSpeedLimiter = 0x10, + RevLimiterActive = 0x20 + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/PitServiceFlag.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/PitServiceFlag.cs new file mode 100644 index 0000000..7555b66 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/PitServiceFlag.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace iRacingSdkWrapper.Bitfields +{ + class PitServiceFlag : BitfieldBase + { + public PitServiceFlag() : this(0) { } + + public PitServiceFlag(int value) : base(value) + { } + } + + [Flags] + public enum PitServiceFlags : uint + { + LFTireChange = 0x0001, + RFTireChange = 0x0002, + LRTireChange = 0x0004, + RRTireChange = 0x0008, + FuelFill = 0x0010, + WindshieldTearoff = 0x0020, + FastRepair = 0x0040 + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/SessionFlag.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/SessionFlag.cs new file mode 100644 index 0000000..63880e0 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Bitfields/SessionFlag.cs @@ -0,0 +1,43 @@ +using System; + +namespace iRacingSdkWrapper.Bitfields +{ + public class SessionFlag : BitfieldBase + { + public SessionFlag(int value) : base(value) + { + } + } + + [Flags] + public enum SessionFlags : uint + { + Checkered = 0x00000001, + White = 0x00000002, + Green = 0x00000004, + Yellow = 0x00000008, + Red = 0x00000010, + Blue = 0x00000020, + Debris = 0x00000040, + Crossed = 0x00000080, + YellowWaving = 0x00000100, + OneLapToGreen = 0x00000200, + GreenHeld = 0x00000400, + TenToGo = 0x00000800, + FiveToGo = 0x00001000, + RandomWaving = 0x00002000, + Caution = 0x00004000, + CautionWaving = 0x00008000, + + Black = 0x00010000, + Disqualify = 0x00020000, + Servicible = 0x00040000, // car is allowed service (not a flag) + Furled = 0x00080000, + Repair = 0x00100000, + + StartHidden = 0x10000000, + StartReady = 0x20000000, + StartSet = 0x40000000, + StartGo = 0x80000000, + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/BroadcastBase.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/BroadcastBase.cs new file mode 100644 index 0000000..d234dd1 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/BroadcastBase.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace iRacingSdkWrapper.Broadcast +{ + public abstract class BroadcastBase + { + private readonly SdkWrapper _wrapper; + + internal BroadcastBase(SdkWrapper wrapper) + { + _wrapper = wrapper; + } + + protected void Broadcast(iRSDKSharp.BroadcastMessageTypes type, int var1, int var2) + { + if (!_wrapper.IsConnected) return; + _wrapper.Sdk.BroadcastMessage(type, var1, var2); + } + + protected void Broadcast(iRSDKSharp.BroadcastMessageTypes type, int var1, int var2, int var3) + { + if (!_wrapper.IsConnected) return; + _wrapper.Sdk.BroadcastMessage(type, var1, var2, var3); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/CameraControl.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/CameraControl.cs new file mode 100644 index 0000000..ed36952 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/CameraControl.cs @@ -0,0 +1,99 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using iRacingSdkWrapper.Bitfields; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Broadcast +{ + /// + /// Provides control over the replay camera and where it is focused. + /// + public class CameraControl : BroadcastBase + { + internal CameraControl(SdkWrapper wrapper) : base(wrapper) + { + } + + /// + /// Switch to the 'focus on crashes' dynamic camera. + /// + public void FocusOnCrashes() + { + SwitchToPosition(-3); + } + + /// + /// Switch to the 'focus on leader' dynamic camera. + /// + public void FocusOnLeader() + { + SwitchToPosition(-2); + } + + /// + /// Switch to the 'focus on most exciting' dynamic camera. + /// + public void FocusMostExciting() + { + SwitchToPosition(-1); + } + + /// + /// Switch the camera to the specified position and set the camera group. + /// + /// The position of the car to switch to. + /// The camera group to use. + public void SwitchToPosition(int position, int group) + { + Broadcast(BroadcastMessageTypes.CamSwitchPos, position, group, 0); + } + + /// + /// Switch the camera to the specified position. + /// + /// The position of the car to switch to. + public void SwitchToPosition(int position) + { + SwitchToPosition(position, 0); + } + + /// + /// Switch the camera to the specified (raw) car number and set the camera group. + /// + /// The car number of the car to switch to. This must be the RAW car number. + /// The camera group to use. + public void SwitchToCar(int carNumberRaw, int group) + { + Broadcast(BroadcastMessageTypes.CamSwitchNum, carNumberRaw, group, 0); + } + + /// + /// Switch the camera to the specified (raw) car number and set the camera group. + /// + /// The car number of the car to switch to. This must be the RAW car number. + public void SwitchToCar(int carNumberRaw) + { + SwitchToCar(carNumberRaw, 0); + } + + /// + /// Switch the camera group to use. + /// + /// The camera group to use. + public void SwitchGroup(int group) + { + Broadcast(BroadcastMessageTypes.CamSwitchPos, 0, group, 0); + } + + /// + /// Set the state of the camera to a (combination of) specified states. + /// + /// A combination of specified states as a bitfield. + public void SetCameraState(CameraState state) + { + Broadcast(BroadcastMessageTypes.CamSetState, (int) state.Value, 0); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/ChatControl.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/ChatControl.cs new file mode 100644 index 0000000..a7e8774 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/ChatControl.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Broadcast +{ + /// + /// Provides control over the chat window. + /// + public class ChatControl : BroadcastBase + { + internal ChatControl(SdkWrapper wrapper) : base(wrapper) + { + } + + /// + /// Clear the chat window. + /// + public void Clear() + { + Broadcast(BroadcastMessageTypes.ChatCommand, (int)ChatCommandModeTypes.Cancel, 0); + } + + /// + /// Start a reply to the last private message. + /// + public void Reply() + { + Broadcast(BroadcastMessageTypes.ChatCommand, (int)ChatCommandModeTypes.Reply, 0); + } + + /// + /// Activate the chat window. + /// + public void Activate() + { + Broadcast(BroadcastMessageTypes.ChatCommand, (int)ChatCommandModeTypes.BeginChat, 0); + } + + /// + /// Send a macro to the chat window. + /// + /// The macro to send. + public void SendMacro(int macro) + { + if (macro < 0 || macro > 14) + throw new ArgumentOutOfRangeException("macro", "Macro must be between 0 and 14."); + Broadcast(BroadcastMessageTypes.ChatCommand, (int)ChatCommandModeTypes.Macro, macro, 0); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/PitCommandControl.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/PitCommandControl.cs new file mode 100644 index 0000000..93a8d65 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/PitCommandControl.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Broadcast +{ + /// + /// Provides control over the pit commands. + /// + public class PitCommandControl : BroadcastBase + { + internal PitCommandControl(SdkWrapper wrapper) : base(wrapper) + { + } + + /// + /// Schedule to add the specified amount of fuel (in liters) in the next pitstop. + /// + /// The amount of fuel (in liters) to add. Use 0 to leave at current value. + public void AddFuel(int amount) + { + Broadcast(BroadcastMessageTypes.PitCommand, (int)PitCommandModeTypes.Fuel, amount, 0); + } + + private void ChangeTire(PitCommandModeTypes type, int pressure) + { + Broadcast(BroadcastMessageTypes.PitCommand, (int)type, pressure); + } + + /// + /// Schedule to change one or more tires and set their new pressures. + /// + /// The scheduled tire changes. + public void ChangeTires(TireChange change) + { + if (change.LeftFront != null && change.LeftFront.Change) + ChangeTire(PitCommandModeTypes.LF, change.LeftFront.Pressure); + + if (change.RightFront != null && change.RightFront.Change) + ChangeTire(PitCommandModeTypes.RF, change.RightFront.Pressure); + + if (change.LeftRear != null && change.LeftRear.Change) + ChangeTire(PitCommandModeTypes.LR, change.LeftRear.Pressure); + + if (change.RightRear != null && change.RightRear.Change) + ChangeTire(PitCommandModeTypes.RR, change.RightRear.Pressure); + } + + /// + /// Schedule to use a windshield tear-off in the next pitstop. + /// + public void Tearoff() + { + Broadcast(BroadcastMessageTypes.PitCommand, (int)PitCommandModeTypes.WS, 0); + } + + /// + /// Schedule to use a fast repair in the next pitstop. + /// + public void FastRepair() + { + Broadcast(BroadcastMessageTypes.PitCommand, (int) PitCommandModeTypes.FastRepair, 0); + } + + /// + /// Clear all pit commands. + /// + public void Clear() + { + Broadcast(BroadcastMessageTypes.PitCommand, (int)PitCommandModeTypes.Clear, 0); + } + + /// + /// Clear all tire changes. + /// + public void ClearTires() + { + Broadcast(BroadcastMessageTypes.PitCommand, (int)PitCommandModeTypes.ClearTires, 0); + } + + public class Tire + { + internal Tire() { } + + /// + /// Whether or not to change this tire. + /// + public bool Change { get; set; } + + /// + /// The new pressure (in kPa) of this tire. + /// + public int Pressure { get; set; } + } + + /// + /// Encapsulates scheduled tire changes for each of the four tires separately. + /// + public class TireChange + { + public TireChange() + { + this.LeftFront = new Tire(); + this.RightFront = new Tire(); + this.LeftRear = new Tire(); + this.RightRear = new Tire(); + } + + public Tire LeftFront { get; set; } + public Tire RightFront { get; set; } + public Tire LeftRear { get; set; } + public Tire RightRear { get; set; } + } + + + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/ReplayControl.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/ReplayControl.cs new file mode 100644 index 0000000..9e26842 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/ReplayControl.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Broadcast +{ + /// + /// Controls the replay playback system. + /// + public class ReplayControl : BroadcastBase + { + public ReplayControl(SdkWrapper wrapper) : base(wrapper) + { + } + + /// + /// Set the replay tape position in number of frames since the session start. + /// + /// + public void SetPosition(int frameFromBeginning) + { + Broadcast(BroadcastMessageTypes.ReplaySetPlayPosition, + (int)ReplayPositionModeTypes.Begin, + frameFromBeginning); + } + + /// + /// Set the replay tape position in number of frames from the session end. + /// + /// + public void SetPositionFromEnd(int frameFromEnd) + { + Broadcast(BroadcastMessageTypes.ReplaySetPlayPosition, + (int)ReplayPositionModeTypes.End, + frameFromEnd); + } + + /// + /// Jump to live. + /// + public void JumpToLive() + { + Jump(ReplaySearchModeTypes.ToEnd); + } + + /// + /// Jump to the start. + /// + public void JumpToStart() + { + Jump(ReplaySearchModeTypes.ToStart); + } + + /// + /// Jump to a specific event. + /// + /// The event to jump to. + public void Jump(ReplaySearchModeTypes replayEvent) + { + Broadcast(BroadcastMessageTypes.ReplaySearch, + (int)replayEvent, 0); + } + + /// + /// Pause the replay. + /// + public void Pause() + { + SetPlaybackSpeed(0, false); + } + + /// + /// Set the playback speed of the replay. + /// + /// The playback speed between -16 (reverse) and 16, with 1 realtime speed and 0 being paused. + public void SetPlaybackSpeed(int speed) + { + SetPlaybackSpeed(speed, false); + } + + /// + /// Set the playback to slow motion and set the speed of the replay. + /// + /// The playback speed between -16 (reverse) and 16, with 1 realtime speed and 0 being paused. + public void SetSlowmotionPlaybackSpeed(int slowmoSpeed) + { + SetPlaybackSpeed(slowmoSpeed, true); + } + + public void SetPlaybackSpeed(int speed, bool slowmo) + { + if (speed < -16 || speed > 16) + throw new ArgumentOutOfRangeException("speed", "Replay speed must be between -16 and 16."); + + Broadcast(BroadcastMessageTypes.ReplaySetPlaySpeed, + speed, slowmo ? 1 : 0, 0); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/TelemetryRecordingControl.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/TelemetryRecordingControl.cs new file mode 100644 index 0000000..b2db862 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/TelemetryRecordingControl.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Broadcast +{ + /// + /// Provides control over the telemetry recording system. + /// + public class TelemetryRecordingControl : BroadcastBase + { + internal TelemetryRecordingControl(SdkWrapper wrapper) : base(wrapper) + { + } + + /// + /// Start recording telemetry. + /// + public void Start() + { + Broadcast(BroadcastMessageTypes.TelemCommand, (int)TelemCommandModeTypes.Start, 0, 0); + } + + /// + /// Stop recording telemetry. + /// + public void Stop() + { + Broadcast(BroadcastMessageTypes.TelemCommand, (int)TelemCommandModeTypes.Stop, 0, 0); + } + + /// + /// Start a new telemetry file. + /// + public void StartNewFile() + { + Broadcast(BroadcastMessageTypes.TelemCommand, (int)TelemCommandModeTypes.Restart, 0, 0); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/TextureControl.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/TextureControl.cs new file mode 100644 index 0000000..0716319 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Broadcast/TextureControl.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using iRSDKSharp; + +namespace iRacingSdkWrapper.Broadcast +{ + /// + /// Provides control over reloading of car textures. + /// + public class TextureControl : BroadcastBase + { + internal TextureControl(SdkWrapper wrapper) : base(wrapper) + { + } + + /// + /// Reload all car textures. + /// + public void Reload() + { + Broadcast(BroadcastMessageTypes.ReloadTextures, (int)ReloadTexturesModeTypes.All, 0, 0); + } + + /// + /// Reload car textures for the specified car. + /// + /// The ID (0-64) of the car to reload. + public void Reload(int carIdx) + { + Broadcast(BroadcastMessageTypes.ReloadTextures, (int)ReloadTexturesModeTypes.CarIdx, carIdx, 0); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Enums.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Enums.cs new file mode 100644 index 0000000..0a8b091 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Enums.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace iRacingSdkWrapper +{ + public enum TrackSurfaces + { + NotInWorld = -1, + OffTrack, + InPitStall, + AproachingPits, + OnTrack + } + + public enum SessionStates + { + Invalid, + GetInCar, + Warmup, + ParadeLaps, + Racing, + Checkered, + CoolDown + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/iRacingSdkWrapper/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..a8d922a --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSdkWrapper")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSdkWrapper")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("cd8abd82-04f7-4757-b479-7cd2d0f2572b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/SdkWrapper.cs b/iRacingSdkWrapper/iRacingSdkWrapper/SdkWrapper.cs new file mode 100644 index 0000000..c15f628 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/SdkWrapper.cs @@ -0,0 +1,455 @@ +using System; +using System.ComponentModel; +using System.Diagnostics; +using System.Threading; +using System.Windows.Threading; +using iRSDKSharp; +using iRacingSdkWrapper.Broadcast; + +namespace iRacingSdkWrapper +{ + /// + /// Provides a useful wrapper of the iRacing SDK. + /// + public sealed class SdkWrapper + { + #region Fields + + internal readonly iRacingSDK sdk; + private readonly SynchronizationContext context; + private int waitTime; + private Mutex readMutex; + + private Thread _looper; + private bool _hasConnected; + + #endregion + + /// + /// Creates a new instance of the SdkWrapper. + /// + public SdkWrapper() + { + this.context = SynchronizationContext.Current; + this.sdk = new iRacingSDK(); + this.EventRaiseType = EventRaiseTypes.CurrentThread; + + readMutex = new Mutex(false); + + this.TelemetryUpdateFrequency = 60; + this.ConnectSleepTime = 1000; + _DriverId = -1; + + this.Replay = new ReplayControl(this); + this.Camera = new CameraControl(this); + this.PitCommands = new PitCommandControl(this); + this.Chat = new ChatControl(this); + this.Textures = new TextureControl(this); + this.TelemetryRecording = new TelemetryRecordingControl(this); + } + + #region Properties + + /// + /// Gets the underlying iRacingSDK object. + /// + public iRacingSDK Sdk { get { return sdk; } } + + /// + /// Gets or sets how events are raised. Choose 'CurrentThread' to raise the events on the thread you created this object on (typically the UI thread), + /// or choose 'BackgroundThread' to raise the events on a background thread, in which case you have to delegate any UI code to your UI thread to avoid cross-thread exceptions. + /// + public EventRaiseTypes EventRaiseType { get; set; } + + private bool _IsRunning; + /// + /// Is the main loop running? + /// + public bool IsRunning { get { return _IsRunning; } } + + private bool _IsConnected; + /// + /// Is the SDK connected to iRacing? + /// + public bool IsConnected { get { return _IsConnected; } } + + private double _TelemetryUpdateFrequency; + /// + /// Gets or sets the number of times the telemetry info is updated per second. The default and maximum is 60 times per second. + /// + public double TelemetryUpdateFrequency + { + get { return _TelemetryUpdateFrequency; } + set + { + if (value <= 0) + throw new ArgumentOutOfRangeException("TelemetryUpdateFrequency must be at least 1."); + if (value > 60) + throw new ArgumentOutOfRangeException("TelemetryUpdateFrequency cannot be more than 60."); + + _TelemetryUpdateFrequency = value; + + waitTime = (int) Math.Floor(1000f/value) - 1; + } + } + + /// + /// The time in milliseconds between each check if iRacing is running. Use a low value (hundreds of milliseconds) to respond quickly to iRacing startup. + /// Use a high value (several seconds) to conserve resources if an immediate response to startup is not required. + /// + public int ConnectSleepTime + { + get; set; + } + + private int _DriverId; + /// + /// Gets the Id (CarIdx) of yourself (the driver running this application). + /// + public int DriverId { get { return _DriverId; } } + + #region Broadcast messages + + /// + /// Controls the replay playback system. + /// + public ReplayControl Replay { get; private set; } + + /// + /// Provides control over the replay camera and where it is focused. + /// + public CameraControl Camera { get; private set; } + + /// + /// Provides control over the pit commands. + /// + public PitCommandControl PitCommands { get; private set; } + + /// + /// Provides control over the chat window. + /// + public ChatControl Chat { get; private set; } + + /// + /// Provides control over reloading of car textures. + /// + public TextureControl Textures { get; private set; } + + /// + /// Provides control over the telemetry recording system. + /// + public TelemetryRecordingControl TelemetryRecording { get; private set; } + + #endregion + + #endregion + + #region Methods + + /// + /// Connects to iRacing and starts the main loop in a background thread. + /// + public void Start() + { + _IsRunning = true; + + if (_looper != null) + { + _looper.Abort(); + } + + _looper = new Thread(Loop); + _looper.Start(); + } + + /// + /// Stops the main loop + /// + public void Stop() + { + _IsRunning = false; + } + + /// + /// Return raw data object from the live telemetry. + /// + /// The name of the telemetry property to obtain. + public object GetData(string headerName) + { + if (!this.IsConnected) return null; + + return sdk.GetData(headerName); + } + + /// + /// Return live telemetry data wrapped in a TelemetryValue object of the specified type. + /// + /// The type of the desired object. + /// The name of the desired object. + public TelemetryValue GetTelemetryValue(string name) + { + return new TelemetryValue(sdk, name); + } + + /// + /// Reads new session info and raises the SessionInfoUpdated event, regardless of if the session info has changed. + /// + public void RequestSessionInfoUpdate() + { + var sessionInfo = sdk.GetSessionInfo(); + var time = (double) sdk.GetData("SessionTime"); + var sessionArgs = new SessionInfoUpdatedEventArgs(sessionInfo, time); + this.RaiseEvent(OnSessionInfoUpdated, sessionArgs); + } + + private object TryGetSessionNum() + { + try + { + var sessionnum = sdk.GetData("SessionNum"); + return sessionnum; + } + catch + { + return null; + } + } + + private void Loop() + { + int lastUpdate = -1; + + while (_IsRunning) + { + // Check if we can find the sim + if (sdk.IsConnected()) + { + if (!_IsConnected) + { + // If this is the first time, raise the Connected event + this.RaiseEvent(OnConnected, EventArgs.Empty); + } + + _hasConnected = true; + _IsConnected = true; + + readMutex.WaitOne(8); + + int attempts = 0; + const int maxAttempts = 99; + + object sessionnum = this.TryGetSessionNum(); + while (sessionnum == null && attempts <= maxAttempts) + { + attempts++; + sessionnum = this.TryGetSessionNum(); + } + if (attempts >= maxAttempts) + { + Debug.WriteLine("Session num too many attempts"); + continue; + } + + // Parse out your own driver Id + if (this.DriverId == -1) + { + _DriverId = (int)sdk.GetData("PlayerCarIdx"); + } + + // Get the session time (in seconds) of this update + var time = (double) sdk.GetData("SessionTime"); + + // Raise the TelemetryUpdated event and pass along the lap info and session time + var telArgs = new TelemetryUpdatedEventArgs(new TelemetryInfo(sdk), time); + this.RaiseEvent(OnTelemetryUpdated, telArgs); + + // Is the session info updated? + int newUpdate = sdk.Header.SessionInfoUpdate; + if (newUpdate != lastUpdate) + { + lastUpdate = newUpdate; + + // Get the session info string + var sessionInfo = sdk.GetSessionInfo(); + + // Raise the SessionInfoUpdated event and pass along the session info and session time. + var sessionArgs = new SessionInfoUpdatedEventArgs(sessionInfo, time); + this.RaiseEvent(OnSessionInfoUpdated, sessionArgs); + } + + + } + else if (_hasConnected) + { + // We have already been initialized before, so the sim is closing + this.RaiseEvent(OnDisconnected, EventArgs.Empty); + + sdk.Shutdown(); + _DriverId = -1; + lastUpdate = -1; + _IsConnected = false; + _hasConnected = false; + } + else + { + _IsConnected = false; + _hasConnected = false; + _DriverId = -1; + + //Try to find the sim + sdk.Startup(); + } + + // Sleep for a short amount of time until the next update is available + if (_IsConnected) + { + if (waitTime <= 0 || waitTime > 1000) waitTime = 15; + Thread.Sleep(waitTime); + } + else + { + // Not connected yet, no need to check every 16 ms, let's try again in some time + Thread.Sleep(ConnectSleepTime); + } + } + + sdk.Shutdown(); + _DriverId = -1; + _IsConnected = false; + } + + #endregion + + #region Events + + /// + /// Event raised when the sim outputs telemetry information (60 times per second). + /// + public event EventHandler TelemetryUpdated; + + /// + /// Event raised when the sim refreshes the session info (few times per minute). + /// + public event EventHandler SessionInfoUpdated; + + /// + /// Event raised when the SDK detects the sim for the first time. + /// + public event EventHandler Connected; + + /// + /// Event raised when the SDK no longer detects the sim (sim closed). + /// + public event EventHandler Disconnected; + + private void RaiseEvent(Action del, T e) + where T : EventArgs + { + var callback = new SendOrPostCallback(obj => del(obj as T)); + + if (context != null && this.EventRaiseType == EventRaiseTypes.CurrentThread) + { + // Post the event method on the thread context, this raises the event on the thread on which the SdkWrapper object was created + context.Post(callback, e); + } + else + { + // Simply invoke the method, this raises the event on the background thread that the SdkWrapper created + // Care must be taken by the user to avoid cross-thread operations + callback.Invoke(e); + } + } + + private void OnSessionInfoUpdated(SessionInfoUpdatedEventArgs e) + { + var handler = this.SessionInfoUpdated; + if (handler != null) handler(this, e); + } + + private void OnTelemetryUpdated(TelemetryUpdatedEventArgs e) + { + var handler = this.TelemetryUpdated; + if (handler != null) handler(this, e); + } + + private void OnConnected(EventArgs e) + { + var handler = this.Connected; + if (handler != null) handler(this, e); + } + + private void OnDisconnected(EventArgs e) + { + var handler = this.Disconnected; + if (handler != null) handler(this, e); + } + + #endregion + + #region Enums + + /// + /// The way in which events of the SDK wrapper are raised. + /// + public enum EventRaiseTypes + { + /// + /// Events are raised on the current thread (the thread on which the SdkWrapper object was created). + /// + CurrentThread, + + /// + /// Events are raised on a separate background thread (synchronization / invokation required to update UI). + /// + BackgroundThread + } + + #endregion + + #region Nested classes + + public class SdkUpdateEventArgs : EventArgs + { + public SdkUpdateEventArgs(double time) + { + _UpdateTime = time; + } + + private readonly double _UpdateTime; + /// + /// Gets the time (in seconds) when this update occured. + /// + public double UpdateTime { get { return _UpdateTime; } } + } + + public class SessionInfoUpdatedEventArgs : SdkUpdateEventArgs + { + public SessionInfoUpdatedEventArgs(string sessionInfo, double time) : base(time) + { + _SessionInfo = new SessionInfo(sessionInfo, time); + } + + private readonly SessionInfo _SessionInfo; + /// + /// Gets the session info. + /// + public SessionInfo SessionInfo { get { return _SessionInfo; } } + } + + public class TelemetryUpdatedEventArgs : SdkUpdateEventArgs + { + public TelemetryUpdatedEventArgs(TelemetryInfo info, double time) : base(time) + { + _TelemetryInfo = info; + } + + private readonly TelemetryInfo _TelemetryInfo; + /// + /// Gets the telemetry info object. + /// + public TelemetryInfo TelemetryInfo { get { return _TelemetryInfo; } } + } + + #endregion + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/SessionInfo.cs b/iRacingSdkWrapper/iRacingSdkWrapper/SessionInfo.cs new file mode 100644 index 0000000..0f26661 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/SessionInfo.cs @@ -0,0 +1,182 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Windows; +using iRSDKSharp; +using YamlDotNet.RepresentationModel; + +namespace iRacingSdkWrapper +{ + /// + /// Represents a single update of the Session Info YAML and includes parsing capabilities. + /// + public class SessionInfo + { + public SessionInfo(string yaml, double updateTime) + { + _updateTime = updateTime; + + _rawYaml = yaml; + + this.FixYaml(yaml); + this.ParseYaml(); + } + + #region Properties + + private readonly double _updateTime; + /// + /// The time of this update. + /// + public double UpdateTime { get { return _updateTime; } } + + private string _yaml; + /// + /// The YAML string representing the session info, modified to ensure correct parsing. + /// + public string Yaml { get { return _yaml; } } + + private string _rawYaml; + /// + /// The raw YAML string as originally returned from the sim. + /// + public string RawYaml { get { return _rawYaml;} } + + private bool _isValidYaml; + public bool IsValidYaml { get { return _isValidYaml; } } + + private YamlStream _yamlStream; + public YamlStream YamlStream { get { return _yamlStream; } } + + private YamlMappingNode _yamlRoot; + public YamlMappingNode YamlRoot { get { return _yamlRoot; } } + + #endregion + + #region Methods + + private void FixYaml(string yaml) + { + // Quick hack: if there's more than 1 colon ":" in a line, keep only the first + using (var reader = new StringReader(yaml)) + { + var builder = new StringBuilder(); + string line; + while ((line = reader.ReadLine()) != null) + { + if (line.Count(c => c == ':') > 1) + { + var chars = line.ToCharArray(); + bool foundFirst = false; + for (int i = 0; i < chars.Length; i++) + { + var c = chars[i]; + if (c == ':') + { + if (!foundFirst) + { + foundFirst = true; + continue; + } + chars[i] = '-'; + } + } + line = new string(chars); + } + builder.AppendLine(line); + } + _yaml = builder.ToString(); + } + + // Incorrect setup info dump fix: remove the setup info + var indexOfSetup = _yaml.IndexOf("CarSetup:"); + if (indexOfSetup > 0) + { + _yaml = _yaml.Substring(0, indexOfSetup); + } + } + + private void ParseYaml() + { + try + { + using (var reader = new StringReader(this.Yaml)) + { + _yamlStream = new YamlStream(); + _yamlStream.Load(reader); + _yamlRoot = (YamlMappingNode)_yamlStream.Documents[0].RootNode; + } + _isValidYaml = true; + } + catch (Exception ex) + { + _isValidYaml = false; + } + + } + + public YamlQuery this[string key] + { + get + { + return YamlQuery.Mapping(_yamlRoot, key); + } + } + + /// + /// Gets a value from the session info YAML, or null if there is an error. + /// + /// The YAML query path to the value. + public string TryGetValue(string query) + { + if (!this.IsValidYaml) return null; + try + { + return YamlParser.Parse(_yaml, query); + } + catch (Exception) + { + return null; + } + } + + /// + /// Gets a value from the session info YAML. Returns true if successfull, false if there is an error. + /// + /// The YAML query path to the value. + /// When this method returns, contains the requested value if the query was valid, or null if the query was invalid. + public bool TryGetValue(string query, out string value) + { + if (!this.IsValidYaml) + { + value = null; + return false; + } + try + { + value = YamlParser.Parse(_yaml, query); + return true; + } + catch (Exception) + { + value = null; + return false; + } + } + + /// + /// Gets a value from the session info YAML. May throw an exception. Use for safer operation. + /// + /// The YAML query path to the value. + public string GetValue(string query) + { + if (!this.IsValidYaml) return null; + return YamlParser.Parse(_yaml, query); + } + + #endregion + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/TelemetryInfo.cs b/iRacingSdkWrapper/iRacingSdkWrapper/TelemetryInfo.cs new file mode 100644 index 0000000..9ae173e --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/TelemetryInfo.cs @@ -0,0 +1,560 @@ +using System.Collections.Generic; +using iRSDKSharp; +using iRacingSdkWrapper.Bitfields; + +namespace iRacingSdkWrapper +{ + /// + /// Represents an object from which you can get Telemetry var headers by name + /// + public sealed class TelemetryInfo + { + private readonly iRacingSDK sdk; + + public TelemetryInfo(iRacingSDK sdk) + { + this.sdk = sdk; + } + + public IEnumerable GetValues() + { + var values = new List(); + values.AddRange(new TelemetryValue[] + { + this.SessionTime, + this.SessionNum, + this.SessionState, + this.SessionUniqueID, + this.SessionFlags, + this.DriverMarker, + this.IsReplayPlaying, + this.ReplayFrameNum, + this.CarIdxLap, + this.CarIdxLapCompleted, + this.CarIdxLapDistPct, + this.CarIdxTrackSurface, + this.CarIdxSteer, + this.CarIdxRPM, + this.CarIdxGear, + this.CarIdxF2Time, + this.CarIdxEstTime, + this.CarIdxOnPitRoad, + this.CarIdxPosition, + this.CarIdxClassPosition, + this.SteeringWheelAngle, + this.Throttle, + this.Brake, + this.Clutch, + this.Gear, + this.RPM, + this.Lap, + this.LapDist, + this.LapDistPct, + this.RaceLaps, + this.LongAccel, + this.LatAccel, + this.VertAccel, + this.RollRate, + this.PitchRate, + this.YawRate, + this.Speed, + this.VelocityX, + this.VelocityY, + this.VelocityZ, + this.Yaw, + this.Pitch, + this.Roll, + this.CamCarIdx, + this.CamCameraNumber, + this.CamCameraState, + this.CamGroupNumber, + this.IsOnTrack, + this.IsInGarage, + this.SteeringWheelTorque, + this.SteeringWheelPctTorque, + this.ShiftIndicatorPct, + this.EngineWarnings, + this.FuelLevel, + this.FuelLevelPct, + this.ReplayPlaySpeed, + this.ReplaySessionTime, + this.ReplaySessionNum, + this.WaterTemp, + this.WaterLevel, + this.FuelPress, + this.OilTemp, + this.OilPress, + this.OilLevel, + this.Voltage, + this.SessionTimeRemain, + this.ReplayFrameNumEnd, + this.AirDensity, + this.AirPressure, + this.AirTemp, + this.FogLevel, + this.Skies, + this.TrackTemp, + this.TrackTempCrew, + this.RelativeHumidity, + this.WeatherType, + this.WindDir, + this.WindVel, + this.MGUKDeployAdapt, + this.MGUKDeployFixed, + this.MGUKRegenGain, + this.EnergyBatteryToMGU, + this.EnergyBudgetBattToMGU, + this.EnergyERSBattery, + this.PowerMGUH, + this.PowerMGUK, + this.TorqueMGUK, + this.DrsStatus, + this.LapCompleted, + this.PlayerCarDriverIncidentCount, + this.PlayerCarTeamIncidentCount, + this.PlayerCarMyIncidentCount, + this.PlayerTrackSurface, + this.PlayerCarIdx + }); + return values; + } + + public TelemetryValue MGUKDeployAdapt { get { return new TelemetryValue(sdk, "dcMGUKDeployAdapt"); } } + + public TelemetryValue MGUKDeployFixed { get { return new TelemetryValue(sdk, "dcMGUKDeployFixed"); } } + + public TelemetryValue MGUKRegenGain { get { return new TelemetryValue(sdk, "dcMGUKRegenGain"); } } + + public TelemetryValue EnergyBatteryToMGU { get { return new TelemetryValue(sdk, "EnergyBatteryToMGU_KLap"); } } + + public TelemetryValue EnergyBudgetBattToMGU { get { return new TelemetryValue(sdk, "EnergyBudgetBattToMGU_KLap"); } } + + public TelemetryValue EnergyERSBattery { get { return new TelemetryValue(sdk, "EnergyERSBattery"); } } + + public TelemetryValue PowerMGUH { get { return new TelemetryValue(sdk, "PowerMGU_H"); } } + + public TelemetryValue PowerMGUK { get { return new TelemetryValue(sdk, "PowerMGU_K"); } } + + public TelemetryValue TorqueMGUK { get { return new TelemetryValue(sdk, "TorqueMGU_K"); } } + + /// + /// Current DRS status. 0 = inactive, 1 = can be activated in next DRS zone, 2 = can be activated now, 3 = active. + /// + public TelemetryValue DrsStatus { get { return new TelemetryValue(sdk, "DRS_Status"); } } + + /// + /// The number of laps you have completed. Note: on Nordschleife Tourist layout, you can complete a lap without starting a new one! + /// + public TelemetryValue LapCompleted { get { return new TelemetryValue(sdk, "LapCompleted"); } } + + + /// + /// Seconds since session start. Unit: s + /// + public TelemetryValue SessionTime { get { return new TelemetryValue(sdk, "SessionTime"); } } + + + /// + /// Session number. + /// + public TelemetryValue SessionNum { get { return new TelemetryValue(sdk, "SessionNum"); } } + + + /// + /// Session state. Unit: irsdk_SessionState + /// + public TelemetryValue SessionState { get { return new TelemetryValue(sdk, "SessionState"); } } + + + /// + /// Session ID. + /// + public TelemetryValue SessionUniqueID { get { return new TelemetryValue(sdk, "SessionUniqueID"); } } + + + /// + /// Session flags. Unit: irsdk_Flags + /// + public TelemetryValue SessionFlags { get { return new TelemetryValue(sdk, "SessionFlags"); } } + + + /// + /// Driver activated flag. + /// + public TelemetryValue DriverMarker { get { return new TelemetryValue(sdk, "DriverMarker"); } } + + + /// + /// 0=replay not playing 1=replay playing. + /// + public TelemetryValue IsReplayPlaying { get { return new TelemetryValue(sdk, "IsReplayPlaying"); } } + + + /// + /// Integer replay frame number (60 per second). + /// + public TelemetryValue ReplayFrameNum { get { return new TelemetryValue(sdk, "ReplayFrameNum"); } } + + + /// + /// Current lap number by car index + /// + public TelemetryValue CarIdxLap { get { return new TelemetryValue(sdk, "CarIdxLap"); } } + + /// + /// Current number of completed laps by car index. Note: On Nordschleife Tourist layout, cars can complete a lap without starting a new lap! + /// + public TelemetryValue CarIdxLapCompleted { get { return new TelemetryValue(sdk, "CarIdxLapCompleted"); } } + + /// + /// Percentage distance around lap by car index. Unit: % + /// + public TelemetryValue CarIdxLapDistPct { get { return new TelemetryValue(sdk, "CarIdxLapDistPct"); } } + + + /// + /// Track surface type by car index. Unit: irsdk_TrkLoc + /// + public TelemetryValue CarIdxTrackSurface { get { return new TelemetryValue(sdk, "CarIdxTrackSurface"); } } + + + /// + /// Steering wheel angle by car index. Unit: rad + /// + public TelemetryValue CarIdxSteer { get { return new TelemetryValue(sdk, "CarIdxSteer"); } } + + + /// + /// Engine rpm by car index. Unit: revs/min + /// + public TelemetryValue CarIdxRPM { get { return new TelemetryValue(sdk, "CarIdxRPM"); } } + + + /// + /// -1=reverse 0=neutral 1..n=current gear by car index. + /// + public TelemetryValue CarIdxGear { get { return new TelemetryValue(sdk, "CarIdxGear"); } } + + public TelemetryValue CarIdxF2Time { get { return new TelemetryValue(sdk, "CarIdxF2Time"); } } + + public TelemetryValue CarIdxEstTime { get { return new TelemetryValue(sdk, "CarIdxEstTime"); } } + + public TelemetryValue CarIdxOnPitRoad { get { return new TelemetryValue(sdk, "CarIdxOnPitRoad"); } } + + public TelemetryValue CarIdxPosition { get { return new TelemetryValue(sdk, "CarIdxPosition"); } } + + public TelemetryValue CarIdxClassPosition { get { return new TelemetryValue(sdk, "CarIdxClassPosition"); } } + + + /// + /// Steering wheel angle. Unit: rad + /// + public TelemetryValue SteeringWheelAngle { get { return new TelemetryValue(sdk, "SteeringWheelAngle"); } } + + + /// + /// 0=off throttle to 1=full throttle. Unit: % + /// + public TelemetryValue Throttle { get { return new TelemetryValue(sdk, "Throttle"); } } + + + /// + /// 0=brake released to 1=max pedal force. Unit: % + /// + public TelemetryValue Brake { get { return new TelemetryValue(sdk, "Brake"); } } + + + /// + /// 0=disengaged to 1=fully engaged. Unit: % + /// + public TelemetryValue Clutch { get { return new TelemetryValue(sdk, "Clutch"); } } + + + /// + /// -1=reverse 0=neutral 1..n=current gear. + /// + public TelemetryValue Gear { get { return new TelemetryValue(sdk, "Gear"); } } + + + /// + /// Engine rpm. Unit: revs/min + /// + public TelemetryValue RPM { get { return new TelemetryValue(sdk, "RPM"); } } + + + /// + /// Lap count. + /// + public TelemetryValue Lap { get { return new TelemetryValue(sdk, "Lap"); } } + + + /// + /// Meters traveled from S/F this lap. Unit: m + /// + public TelemetryValue LapDist { get { return new TelemetryValue(sdk, "LapDist"); } } + + + /// + /// Percentage distance around lap. Unit: % + /// + public TelemetryValue LapDistPct { get { return new TelemetryValue(sdk, "LapDistPct"); } } + + + /// + /// Laps completed in race. + /// + public TelemetryValue RaceLaps { get { return new TelemetryValue(sdk, "RaceLaps"); } } + + + /// + /// Longitudinal acceleration (including gravity). Unit: m/s^2 + /// + public TelemetryValue LongAccel { get { return new TelemetryValue(sdk, "LongAccel"); } } + + + /// + /// Lateral acceleration (including gravity). Unit: m/s^2 + /// + public TelemetryValue LatAccel { get { return new TelemetryValue(sdk, "LatAccel"); } } + + + /// + /// Vertical acceleration (including gravity). Unit: m/s^2 + /// + public TelemetryValue VertAccel { get { return new TelemetryValue(sdk, "VertAccel"); } } + + + /// + /// Roll rate. Unit: rad/s + /// + public TelemetryValue RollRate { get { return new TelemetryValue(sdk, "RollRate"); } } + + + /// + /// Pitch rate. Unit: rad/s + /// + public TelemetryValue PitchRate { get { return new TelemetryValue(sdk, "PitchRate"); } } + + + /// + /// Yaw rate. Unit: rad/s + /// + public TelemetryValue YawRate { get { return new TelemetryValue(sdk, "YawRate"); } } + + + /// + /// GPS vehicle speed. Unit: m/s + /// + public TelemetryValue Speed { get { return new TelemetryValue(sdk, "Speed"); } } + + + /// + /// X velocity. Unit: m/s + /// + public TelemetryValue VelocityX { get { return new TelemetryValue(sdk, "VelocityX"); } } + + + /// + /// Y velocity. Unit: m/s + /// + public TelemetryValue VelocityY { get { return new TelemetryValue(sdk, "VelocityY"); } } + + + /// + /// Z velocity. Unit: m/s + /// + public TelemetryValue VelocityZ { get { return new TelemetryValue(sdk, "VelocityZ"); } } + + + /// + /// Yaw orientation. Unit: rad + /// + public TelemetryValue Yaw { get { return new TelemetryValue(sdk, "Yaw"); } } + + + /// + /// Pitch orientation. Unit: rad + /// + public TelemetryValue Pitch { get { return new TelemetryValue(sdk, "Pitch"); } } + + + /// + /// Roll orientation. Unit: rad + /// + public TelemetryValue Roll { get { return new TelemetryValue(sdk, "Roll"); } } + + + /// + /// Active camera's focus car index. + /// + public TelemetryValue CamCarIdx { get { return new TelemetryValue(sdk, "CamCarIdx"); } } + + + /// + /// Active camera number. + /// + public TelemetryValue CamCameraNumber { get { return new TelemetryValue(sdk, "CamCameraNumber"); } } + + + /// + /// Active camera group number. + /// + public TelemetryValue CamGroupNumber { get { return new TelemetryValue(sdk, "CamGroupNumber"); } } + + + /// + /// State of camera system. Unit: irsdk_CameraState + /// + public TelemetryValue CamCameraState { get { return new TelemetryValue(sdk, "CamCameraState"); } } + + + /// + /// 1=Car on track physics running. + /// + public TelemetryValue IsOnTrack { get { return new TelemetryValue(sdk, "IsOnTrack"); } } + + + /// + /// 1=Car in garage physics running. + /// + public TelemetryValue IsInGarage { get { return new TelemetryValue(sdk, "IsInGarage"); } } + + + /// + /// Output torque on steering shaft. Unit: N*m + /// + public TelemetryValue SteeringWheelTorque { get { return new TelemetryValue(sdk, "SteeringWheelTorque"); } } + + + /// + /// Force feedback % max torque on steering shaft. Unit: % + /// + public TelemetryValue SteeringWheelPctTorque { get { return new TelemetryValue(sdk, "SteeringWheelPctTorque"); } } + + + /// + /// Percent of shift indicator to light up. Unit: % + /// + public TelemetryValue ShiftIndicatorPct { get { return new TelemetryValue(sdk, "ShiftIndicatorPct"); } } + + + /// + /// Bitfield for warning lights. Unit: irsdk_EngineWarnings + /// + public TelemetryValue EngineWarnings { get { return new TelemetryValue(sdk, "EngineWarnings"); } } + + + /// + /// Liters of fuel remaining. Unit: l + /// + public TelemetryValue FuelLevel { get { return new TelemetryValue(sdk, "FuelLevel"); } } + + + /// + /// Percent fuel remaining. Unit: % + /// + public TelemetryValue FuelLevelPct { get { return new TelemetryValue(sdk, "FuelLevelPct"); } } + + + /// + /// Replay playback speed. + /// + public TelemetryValue ReplayPlaySpeed { get { return new TelemetryValue(sdk, "ReplayPlaySpeed"); } } + + + /// + /// 0=not slow motion 1=replay is in slow motion. + /// + public TelemetryValue ReplayPlaySlowMotion { get { return new TelemetryValue(sdk, "ReplayPlaySlowMotion"); } } + + + /// + /// Seconds since replay session start. Unit: s + /// + public TelemetryValue ReplaySessionTime { get { return new TelemetryValue(sdk, "ReplaySessionTime"); } } + + + /// + /// Replay session number. + /// + public TelemetryValue ReplaySessionNum { get { return new TelemetryValue(sdk, "ReplaySessionNum"); } } + + + /// + /// Engine coolant temp. Unit: C + /// + public TelemetryValue WaterTemp { get { return new TelemetryValue(sdk, "WaterTemp"); } } + + + /// + /// Engine coolant level. Unit: l + /// + public TelemetryValue WaterLevel { get { return new TelemetryValue(sdk, "WaterLevel"); } } + + + /// + /// Engine fuel pressure. Unit: bar + /// + public TelemetryValue FuelPress { get { return new TelemetryValue(sdk, "FuelPress"); } } + + + /// + /// Engine oil temperature. Unit: C + /// + public TelemetryValue OilTemp { get { return new TelemetryValue(sdk, "OilTemp"); } } + + + /// + /// Engine oil pressure. Unit: bar + /// + public TelemetryValue OilPress { get { return new TelemetryValue(sdk, "OilPress"); } } + + + /// + /// Engine oil level. Unit: l + /// + public TelemetryValue OilLevel { get { return new TelemetryValue(sdk, "OilLevel"); } } + + + /// + /// Engine voltage. Unit: V + /// + public TelemetryValue Voltage { get { return new TelemetryValue(sdk, "Voltage"); } } + + public TelemetryValue SessionTimeRemain { get { return new TelemetryValue(sdk, "SessionTimeRemain"); } } + + public TelemetryValue ReplayFrameNumEnd { get { return new TelemetryValue(sdk, "ReplayFrameNumEnd"); } } + + public TelemetryValue AirDensity { get { return new TelemetryValue(sdk, "AirDensity"); } } + + public TelemetryValue AirPressure { get { return new TelemetryValue(sdk, "AirPressure"); } } + + public TelemetryValue AirTemp { get { return new TelemetryValue(sdk, "AirTemp"); } } + + public TelemetryValue FogLevel { get { return new TelemetryValue(sdk, "FogLevel"); } } + + public TelemetryValue Skies { get { return new TelemetryValue(sdk, "Skies"); } } + + public TelemetryValue TrackTemp { get { return new TelemetryValue(sdk, "TrackTemp"); } } + + public TelemetryValue TrackTempCrew { get { return new TelemetryValue(sdk, "TrackTempCrew"); } } + + public TelemetryValue RelativeHumidity { get { return new TelemetryValue(sdk, "RelativeHumidity"); } } + + public TelemetryValue WeatherType { get { return new TelemetryValue(sdk, "WeatherType"); } } + + public TelemetryValue WindDir { get { return new TelemetryValue(sdk, "WindDir"); } } + + public TelemetryValue WindVel { get { return new TelemetryValue(sdk, "WindVel"); } } + + public TelemetryValue PlayerCarTeamIncidentCount { get { return new TelemetryValue(sdk, "PlayerCarTeamIncidentCount"); } } + + public TelemetryValue PlayerCarMyIncidentCount { get { return new TelemetryValue(sdk, "PlayerCarMyIncidentCount"); } } + + public TelemetryValue PlayerCarDriverIncidentCount { get { return new TelemetryValue(sdk, "PlayerCarDriverIncidentCount"); } } + + public TelemetryValue PlayerTrackSurface { get { return new TelemetryValue(sdk, "PlayerTrackSurface"); } } + + public TelemetryValue PlayerCarIdx { get { return new TelemetryValue(sdk, "PlayerCarIdx"); } } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/TelemetryValue.cs b/iRacingSdkWrapper/iRacingSdkWrapper/TelemetryValue.cs new file mode 100644 index 0000000..e847dfa --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/TelemetryValue.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using iRSDKSharp; +using iRacingSdkWrapper.Bitfields; + +namespace iRacingSdkWrapper +{ + public abstract class TelemetryValue + { + protected TelemetryValue(iRSDKSharp.iRacingSDK sdk, string name) + { + if (sdk == null) throw new ArgumentNullException("sdk"); + + _exists = sdk.VarHeaders.ContainsKey(name); + if (_exists) + { + var header = sdk.VarHeaders[name]; + _name = name; + _description = header.Desc; + _unit = header.Unit; + _type = header.Type; + } + } + + private readonly bool _exists; + /// + /// Whether or not a telemetry value with this name exists on the current car. + /// + public bool Exists { get { return _exists; } } + + private readonly string _name; + /// + /// The name of this telemetry value parameter. + /// + public string Name { get { return _name; } } + + private readonly string _description; + /// + /// The description of this parameter. + /// + public string Description { get { return _description; } } + + private readonly string _unit; + /// + /// The real world unit for this parameter. + /// + public string Unit { get { return _unit; } } + + private readonly CVarHeader.VarType _type; + /// + /// The data-type for this parameter. + /// + public CVarHeader.VarType Type { get { return _type; } } + + public abstract object GetValue(); + } + + /// + /// Represents a telemetry parameter of the specified type. + /// + /// The .NET type of this parameter (int, char, float, double, bool, or arrays) + public sealed class TelemetryValue : TelemetryValue + { + public TelemetryValue(iRSDKSharp.iRacingSDK sdk, string name) + : base(sdk, name) + { + this.GetData(sdk); + } + + private void GetData(iRacingSDK sdk) + { + try + { + var data = sdk.GetData(this.Name); + + var type = typeof(T); + if (type.BaseType != null && type.BaseType.IsGenericType && type.BaseType.GetGenericTypeDefinition() == typeof(BitfieldBase<>)) + { + _Value = (T)Activator.CreateInstance(type, new[] { data }); + } + else + { + _Value = (T)data; + } + } + catch (Exception) + { + } + } + + private T _Value; + /// + /// The value of this parameter. + /// + public T Value { get { return _Value; } } + + public override object GetValue() + { + return this.Value; + } + + public override string ToString() + { + return string.Format("{0} {1}", this.Value, this.Unit); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/YamlQuery.cs b/iRacingSdkWrapper/iRacingSdkWrapper/YamlQuery.cs new file mode 100644 index 0000000..d2b0bc4 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/YamlQuery.cs @@ -0,0 +1,224 @@ +using System; +using System.Collections.Generic; +using System.Data.Odbc; +using System.Linq; +using System.Text; +using System.Windows; +using YamlDotNet.Core; +using YamlDotNet.RepresentationModel; + +namespace iRacingSdkWrapper +{ + public class YamlQuery + { + protected YamlQuery(YamlQuery parent, bool error, YamlMappingNode root, string key) + { + _path = parent == null ? "" : parent.QueryPath; + _path += key + ":"; + + this.IsError = error; + if (!error) + { + // Find next mapping node + this.Node = Find(root, key); + } + } + + protected YamlQuery(YamlQuery parent, bool error, YamlSequenceNode root, string key, object value) + { + _path = parent == null ? "" : parent.QueryPath; + _path += string.Format("{0}:{{{1}}}", key, value); + + // Find sequencing node with matching value + this.IsError = error; + if (!error) + { + // Find next mapping node + this.Node = FindSequence(root, key, value); + } + } + + internal static YamlQuery Mapping(YamlMappingNode root, string key) + { + return new YamlQuery(null, false, root, key); + } + + private static YamlQuery Error(YamlQuery parent, string error, string key) + { + var query = new YamlQuery(parent, true, null, key); + query.ErrorMessage = error; + return query; + } + + private static YamlQuery Error(YamlQuery parent, string error, string key, object value) + { + var query = new YamlQuery(parent, true, null, key, value); + query.ErrorMessage = error; + return query; + } + + private string _path; + public string QueryPath { get { return _path; } } + + protected bool IsError { get; private set; } + internal string ErrorMessage { get; set; } + + internal YamlNode Node { get; set; } + + private YamlNode Find(YamlMappingNode node, string key) + { + if (node == null) this.IsError = true; + if (this.IsError) return null; + return node.Children.FirstOrDefault(kvp => kvp.Key.ToString() == key).Value; + } + + private YamlNode FindSequence(YamlSequenceNode node, string key, object value) + { + if (this.IsError) return null; + + foreach (var child in node.Children) + { + var mapping = (YamlMappingNode) child; + foreach (var mappingChild in mapping.Children) + { + if (mappingChild.Key.ToString() == key) + { + // Found key, check value, otherwise skip this mappingChild + if (mappingChild.Value.ToString() == value.ToString()) + { + // Value matches, return mapping + return mapping; + } + else + { + // Value does not match, skip this child + break; + } + } + } + } + return null; + } + + private string GetValueSafe() + { + if (this.IsError) return null; + if (this.Node == null) return null; + + var type = this.Node.GetType(); + if (type == typeof(YamlScalarNode)) + { + var scalar = (YamlScalarNode)this.Node; + return scalar.Value; + } + return null; + } + + /// + /// Gets the value of the result of the current YamlQuery. May throw an exception if the query is invalid or does not return data. + /// Use GetValue method to prevent exceptions. + /// + public string Value + { + get + { + if (this.IsError) + { + throw new YamlQueryException(this.ErrorMessage); + } + + var value = this.GetValueSafe(); + if (value == null) + throw new YamlQueryException("The YAML path returned null: " + this.QueryPath); + + return value; + } + } + + /// + /// Gets the value of the result of the current YamlQuery, or returns a default value (or null) in case the query is invalid or does not return data. + /// + /// The default value to return in case the query is invalid or does not return data. + public string GetValue(string defaultValue = null) + { + try + { + return this.Value; + } + catch (Exception ex) + { + return defaultValue; + } + } + + /// + /// Attempts to get the value of the result of the current YamlQuery and modifies the parameter with the value. Returns true if the value was found, + /// or false if the query is invalid or does not return data. + /// + /// This parameter is modified and contains the result of the query if valid, or null otherwise. + public bool TryGetValue(out string val) + { + try + { + val = this.Value; + return true; + } + catch (Exception) + { + val = null; + return false; + } + } + + public YamlQuery this[string key] + { + get + { + // Are we in an incorrect path? + if (this.IsError) return YamlQuery.Error(this, this.ErrorMessage, key); + + // Current node should be a mapping node + if (this.Node == null) + return YamlQuery.Error(this, "The YAML query path is incorrect: " + this.QueryPath, key); + + var type = this.Node.GetType(); + if (type != typeof(YamlMappingNode)) + return YamlQuery.Error(this, + string.Format("The YAML query path '{0}' is incorrect: expected a YamlMappingNode, but received a {1}.", this.QueryPath, type.Name), + key); + + return new YamlQuery(this, false, (YamlMappingNode)this.Node, key); + } + } + + public YamlQuery this[string key, object value] + { + get + { + // Are we in an incorrect path? + if (this.IsError) return YamlQuery.Error(this, this.ErrorMessage, key, value); + + // Current node should be a sequence node + if (this.Node == null) + return YamlQuery.Error(this, "The YAML query path is incorrect: " + this.QueryPath, key, value); + + var type = this.Node.GetType(); + if (type != typeof(YamlSequenceNode)) + return YamlQuery.Error(this, + string.Format("The YAML query path '{0}' is incorrect: expected a YamlSequenceNode, but received a {1}.", this.QueryPath, type.Name), key, value); + + return new YamlQuery(this, false, (YamlSequenceNode)this.Node, key, value); + } + } + + public override string ToString() + { + return this.QueryPath; + } + + public class YamlQueryException : Exception + { + public YamlQueryException(string message) : base(message) { } + } + } +} diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/iRacingSdkWrapper.csproj b/iRacingSdkWrapper/iRacingSdkWrapper/iRacingSdkWrapper.csproj new file mode 100644 index 0000000..a2c8cc0 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/iRacingSdkWrapper.csproj @@ -0,0 +1,92 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {D6DB568B-35B3-49EB-8CB3-E4E5F1424247} + Library + Properties + iRacingSdkWrapper + iRacingSdkWrapper + v4.7.2 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + false + + + + + + + + + + + + + ..\..\packages\YamlDotNet.12.2.1\lib\net47\YamlDotNet.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {72631b85-eb9a-473e-9b4c-65b355a9000d} + iRSDKSharp + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/packages.config b/iRacingSdkWrapper/iRacingSdkWrapper/packages.config new file mode 100644 index 0000000..79c2475 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSdkWrapper/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/iRacingSdkWrapper/telemetry_11_23_15.pdf b/iRacingSdkWrapper/iRacingSdkWrapper/telemetry_11_23_15.pdf new file mode 100644 index 0000000..38dd46e Binary files /dev/null and b/iRacingSdkWrapper/iRacingSdkWrapper/telemetry_11_23_15.pdf differ diff --git a/iRacingSdkWrapper/iRacingSdkWrapperTutorial.pdf b/iRacingSdkWrapper/iRacingSdkWrapperTutorial.pdf new file mode 100644 index 0000000..c661c2c Binary files /dev/null and b/iRacingSdkWrapper/iRacingSdkWrapperTutorial.pdf differ diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/Driver.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/Driver.cs new file mode 100644 index 0000000..ddb1fc0 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/Driver.cs @@ -0,0 +1,253 @@ +using System; +using System.Diagnostics; +using System.Linq; +using iRacingSdkWrapper; + +namespace iRacingSimulator.Drivers +{ + [Serializable] + public partial class Driver + { + private const string PACECAR_NAME = "safety pcfr500s"; + + public Driver() + { + this.Car = new DriverCarInfo(); + this.PitInfo = new DriverPitInfo(this); + this.Results = new DriverResults(this); + this.QualyResults = new DriverQualyResults(this); + this.Live = new DriverLiveInfo(this); + this.Championship = new DriverChampInfo(this); + this.Private = new DriverPrivateInfo(this); + } + + /// + /// If true, this is your driver on track. + /// + public bool IsCurrentDriver { get; set; } + + public int Id { get; set; } + public int CustId { get; set; } + public string Name { get; set; } + public string ShortName { get; set; } + public string CarNumber { get { return this.Car.CarNumber; } } + + public int TeamId { get; set; } + public string TeamName { get; set; } + + public int IRating { get; set; } + public License License { get; set; } + + public bool IsSpectator { get; set; } + public bool IsPacecar { get; set; } + + public string HelmetDesign { get; set; } + public string CarDesign { get; set; } + public string SuitDesign { get; set; } + public string CarNumberDesign { get; set; } + public string CarSponsor1 { get; set; } + public string CarSponsor2 { get; set; } + + public string ClubName { get; set; } + public string DivisionName { get; set; } + + public DriverCarInfo Car { get; set; } + public DriverPitInfo PitInfo { get; set; } + public DriverResults Results { get; private set; } + public DriverSessionResults CurrentResults { get; set; } + public DriverQualyResults QualyResults { get; set; } + public DriverLiveInfo Live { get; private set; } + public DriverChampInfo Championship { get; private set; } + public DriverPrivateInfo Private { get; private set; } + + public string LongDisplay + { + get { return string.Format("#{0} {1}{2}", + this.Car.CarNumber, + this.Name, + this.TeamId > 0 ? " (" + this.TeamName + ")" : ""); } + } + + public void ParseDynamicSessionInfo(SessionInfo info) + { + // Parse only session info that could have changed (driver dependent) + var query = info["DriverInfo"]["Drivers"]["CarIdx", this.Id]; + + this.Name = query["UserName"].GetValue(""); + this.CustId = Parser.ParseInt(query["UserID"].GetValue("0")); + this.ShortName = query["AbbrevName"].GetValue(); + + this.IRating = Parser.ParseInt(query["IRating"].GetValue()); + var licenseLevel = Parser.ParseInt(query["LicLevel"].GetValue()); + var licenseSublevel = Parser.ParseInt(query["LicSubLevel"].GetValue()); + var licenseColor = Parser.ParseColor(query["LicColor"].GetValue()); + this.License = new License(licenseLevel, licenseSublevel, licenseColor); + + this.IsSpectator = Parser.ParseInt(query["IsSpectator"].GetValue()) == 1; + + this.HelmetDesign = query["HelmetDesignStr"].GetValue(); + this.CarDesign = query["CarDesignStr"].GetValue(); + this.SuitDesign = query["SuitDesignStr"].GetValue(); + this.CarNumberDesign = query["CarNumberDesignStr"].GetValue(); + this.CarSponsor1 = query["CarSponsor_1"].GetValue(); + this.CarSponsor2 = query["CarSponsor_2"].GetValue(); + this.ClubName = query["ClubName"].GetValue(); + this.DivisionName = query["DivisionName"].GetValue(); + } + + public void ParseStaticSessionInfo(SessionInfo info) + { + // Parse only static session info that never changes (car dependent) + var query = info["DriverInfo"]["Drivers"]["CarIdx", this.Id]; + + this.TeamId = Parser.ParseInt(query["TeamID"].GetValue()); + this.TeamName = query["TeamName"].GetValue(); + + this.Car.CarId = Parser.ParseInt(query["CarID"].GetValue()); + this.Car.CarNumber = query["CarNumber"].GetValue(); + this.Car.CarNumberRaw = Parser.ParseInt(query["CarNumberRaw"].GetValue()); + this.Car.CarName = query["CarScreenName"].GetValue(); + this.Car.CarClassId = Parser.ParseInt(query["CarClassID"].GetValue()); + this.Car.CarClassRelSpeed = Parser.ParseInt(query["CarClassRelSpeed"].GetValue()); + this.Car.CarClassColor = Parser.ParseColor(query["CarClassColor"].GetValue()); + this.Car.CarClassShortName = query["CarClassShortName"].GetValue(); + this.Car.CarShortName = query["CarScreenNameShort"].GetValue(); + this.Car.CarPath = query["CarPath"].GetValue(); + + this.IsPacecar = this.CustId == -1 || this.Car.CarName == PACECAR_NAME; + } + + public static Driver FromSessionInfo(SessionInfo info, int carIdx) + { + var query = info["DriverInfo"]["Drivers"]["CarIdx", carIdx]; + + string name; + if (!query["UserName"].TryGetValue(out name)) + { + // Driver not found + return null; + } + + var driver = new Driver(); + driver.Id = carIdx; + driver.ParseStaticSessionInfo(info); + driver.ParseDynamicSessionInfo(info); + + return driver; + } + + internal void UpdateResultsInfo(int sessionNumber, YamlQuery query, int position) + { + this.Results.SetResults(sessionNumber, query, position); + this.CurrentResults = this.Results.Current; + } + + internal void UpdateQualyResultsInfo(YamlQuery query, int position) + { + this.QualyResults.ParseYaml(query, position); + } + + internal void UpdateLiveInfo(TelemetryInfo e) + { + this.Live.ParseTelemetry(e); + } + + internal void UpdatePrivateInfo(TelemetryInfo e) + { + this.Private.ParseTelemetry(e); + } + + private double _prevPos; + + public void UpdateSectorTimes(Track track, TelemetryInfo telemetry) + { + if (track == null) return; + if (track.Sectors.Count == 0) return; + + var results = this.CurrentResults; + if (results != null) + { + var sectorcount = track.Sectors.Count; + + // Set arrays + if (results.SectorTimes == null || results.SectorTimes.Length == 0) + { + results.SectorTimes = track.Sectors.Select(s => s.Copy()).ToArray(); + } + + var p0 = _prevPos; + var p1 = telemetry.CarIdxLapDistPct.Value[this.Id]; + var dp = p1 - p0; + + if (p1 < -0.5) + { + // Not in world? + return; + } + + var t = telemetry.SessionTime.Value; + + // Check lap crossing + if (p0 - p1 > 0.5) // more than 50% jump in track distance == lap crossing occurred from 0.99xx -> 0.00x + { + this.Live.CurrentSector = 0; + this.Live.CurrentFakeSector = 0; + p0 -= 1; + } + + // Check all real sectors + foreach (var s in results.SectorTimes) + { + if (p1 > s.StartPercentage && p0 <= s.StartPercentage) + { + // Crossed into new sector + var crossTime = (float)(t - (p1 - s.StartPercentage) * dp); + + // Finish previous + var prevNum = s.Number <= 0 ? sectorcount - 1 : s.Number - 1; + var sector = results.SectorTimes[prevNum]; + if (sector != null && sector.EnterSessionTime > 0) + { + sector.SectorTime = new Laptime((float)(crossTime - sector.EnterSessionTime)); + } + + // Begin next sector + s.EnterSessionTime = crossTime; + + this.Live.CurrentSector = s.Number; + + break; + } + } + + // Check 'fake' sectors (divide track into thirds) + sectorcount = 3; + foreach (var s in results.FakeSectorTimes) + { + if (p1 > s.StartPercentage && p0 <= s.StartPercentage) + { + // Crossed into new sector + var crossTime = (float)(t - (p1 - s.StartPercentage) * dp); + + // Finish previous + var prevNum = s.Number <= 0 ? sectorcount - 1 : s.Number - 1; + var sector = results.FakeSectorTimes[prevNum]; + if (sector != null && sector.EnterSessionTime > 0) + { + sector.SectorTime = new Laptime((float)(crossTime - sector.EnterSessionTime)); + } + + // Begin next sector + s.EnterSessionTime = crossTime; + + this.Live.CurrentFakeSector = s.Number; + + break; + } + } + + _prevPos = p1; + } + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverCarInfo.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverCarInfo.cs new file mode 100644 index 0000000..b459556 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverCarInfo.cs @@ -0,0 +1,32 @@ +using System; +using System.Windows.Media; + +namespace iRacingSimulator.Drivers +{ + [Serializable] + public class DriverCarInfo + { + public string CarNumber { get; set; } + public int CarNumberRaw { get; set; } + public int CarId { get; set; } + public string CarName { get; set; } + public int CarClassId { get; set; } + public int CarClassRelSpeed { get; set; } + public Color CarClassColor { get; set; } + + /// + /// Gets the short class name for this car. + /// + public string CarClassShortName { get; set; } + + /// + /// Gets the short screen name for this car (e.g. "MX-5 Cup") + /// + public string CarShortName { get; set; } + + /// + /// Directory name of this car (e.g. "mx5 mx52016") + /// + public string CarPath { get; set; } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverChampInfo.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverChampInfo.cs new file mode 100644 index 0000000..36cf4bd --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverChampInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace iRacingSimulator.Drivers +{ + public class DriverChampInfo + { + private readonly Driver _driver; + + public DriverChampInfo(Driver driver) + { + _driver = driver; + } + + public int LivePosition { get; set; } + public int PreviousPosition { get; set; } + public int LivePoints { get; set; } + public int PreviousPoints { get; set; } + public int CurrentRacePoints { get; set; } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverLiveInfo.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverLiveInfo.cs new file mode 100644 index 0000000..ce22d7f --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverLiveInfo.cs @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using iRacingSdkWrapper; + +namespace iRacingSimulator.Drivers +{ + [Serializable] + public class DriverLiveInfo + { + private const float SPEED_CALC_INTERVAL = 0.5f; + + public DriverLiveInfo(Driver driver) + { + _driver = driver; + } + + private readonly Driver _driver; + + public Driver Driver + { + get { return _driver; } + } + + public int Position { get; set; } + public int ClassPosition { get; set; } + public int Lap { get; private set; } + public float LapDistance { get; private set; } + + public float TotalLapDistance + { + get { return Lap + LapDistance; } + } + + public TrackSurfaces TrackSurface { get; private set; } + + public int Gear { get; private set; } + public float Rpm { get; private set; } + public double SteeringAngle { get; private set; } + + public double Speed { get; private set; } + public double SpeedKph { get; private set; } + + public string DeltaToLeader { get; set; } + public string DeltaToNext { get; set; } + + public int CurrentSector { get; set; } + public int CurrentFakeSector { get; set; } + + public void ParseTelemetry(TelemetryInfo e) + { + this.Lap = e.CarIdxLap.Value[this.Driver.Id]; + this.LapDistance = e.CarIdxLapDistPct.Value[this.Driver.Id]; + this.TrackSurface = e.CarIdxTrackSurface.Value[this.Driver.Id]; + + this.Gear = e.CarIdxGear.Value[this.Driver.Id]; + this.Rpm = e.CarIdxRPM.Value[this.Driver.Id]; + this.SteeringAngle = e.CarIdxSteer.Value[this.Driver.Id]; + + this.Driver.PitInfo.CalculatePitInfo(e.SessionTime.Value); + } + + private double _prevSpeedUpdateTime; + private double _prevSpeedUpdateDist; + + public void CalculateSpeed(TelemetryInfo current, double? trackLengthKm) + { + if (current == null) return; + if (trackLengthKm == null) return; + + try + { + var t1 = current.SessionTime.Value; + var t0 = _prevSpeedUpdateTime; + var time = t1 - t0; + + if (time < SPEED_CALC_INTERVAL) + { + // Ignore + return; + } + + var p1 = current.CarIdxLapDistPct.Value[this.Driver.Id]; + var p0 = _prevSpeedUpdateDist; + + if (p1 < -0.5 || _driver.Live.TrackSurface == TrackSurfaces.NotInWorld) + { + // Not in world? + return; + } + + if (p0 - p1 > 0.5) + { + // Lap crossing + p1 += 1; + } + var distancePct = p1 - p0; + + var distance = distancePct*trackLengthKm.GetValueOrDefault()*1000; //meters + + + if (time >= Double.Epsilon) + { + this.Speed = distance/(time); // m/s + } + else + { + if (distance < 0) + this.Speed = Double.NegativeInfinity; + else + this.Speed = Double.PositiveInfinity; + } + this.SpeedKph = this.Speed * 3.6; + + _prevSpeedUpdateTime = t1; + _prevSpeedUpdateDist = p1; + } + catch (Exception ex) + { + //Log.Instance.LogError("Calculating speed of car " + this.Driver.Id, ex); + this.Speed = 0; + } + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverPitInfo.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverPitInfo.cs new file mode 100644 index 0000000..f39fb86 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverPitInfo.cs @@ -0,0 +1,154 @@ +using System; +using System.Diagnostics; +using iRacingSdkWrapper; +using iRacingSimulator.Events; + +namespace iRacingSimulator.Drivers +{ + [Serializable] + public class DriverPitInfo + { + private const float PIT_MINSPEED = 0.01f; + + public DriverPitInfo(Driver driver) + { + _driver = driver; + } + + private readonly Driver _driver; + private bool _hasIncrementedCounter; + + public int Pitstops { get; set; } + + public bool InPitLane { get; set; } + public bool InPitStall { get; set; } + + public double? PitLaneEntryTime { get; set; } + public double? PitLaneExitTime { get; set; } + + public double? PitStallEntryTime { get; set; } + public double? PitStallExitTime { get; set; } + + public double LastPitLaneTimeSeconds { get; set; } + public double LastPitStallTimeSeconds { get; set; } + + public double CurrentPitLaneTimeSeconds { get; set; } + public double CurrentPitStallTimeSeconds { get; set; } + + public int LastPitLap { get; set; } + public int CurrentStint { get; set; } + + public void CalculatePitInfo(double time) + { + // If we are not in the world (blinking?), stop checking + if (_driver.Live.TrackSurface == TrackSurfaces.NotInWorld) + { + return; + } + + // Are we NOW in pit lane (pitstall includes pitlane) + this.InPitLane = _driver.Live.TrackSurface == TrackSurfaces.AproachingPits || + _driver.Live.TrackSurface == TrackSurfaces.InPitStall; + + // Are we NOW in pit stall? + this.InPitStall = _driver.Live.TrackSurface == TrackSurfaces.InPitStall; + + + this.CurrentStint = _driver.Results.Current.LapsComplete - this.LastPitLap; + + // Were we already in pitlane previously? + if (this.PitLaneEntryTime == null) + { + // We were not previously in pitlane + if (this.InPitLane) + { + // We have only just now entered pitlane + this.PitLaneEntryTime = time; + this.CurrentPitLaneTimeSeconds = 0; + + Sim.Instance.NotifyPitstop(RaceEvent.EventTypes.PitEntry, _driver); + } + } + else + { + // We were already in pitlane but have not exited yet + this.CurrentPitLaneTimeSeconds = time - this.PitLaneEntryTime.Value; + + // Were we already in pit stall? + if (this.PitStallEntryTime == null) + { + // We were not previously in our pit stall yet + if (this.InPitStall) + { + if (Math.Abs(_driver.Live.Speed) > PIT_MINSPEED) + { + Debug.WriteLine("PIT: did not stop in pit stall, ignored."); + } + else + { + // We have only just now entered our pit stall + + this.PitStallEntryTime = time; + this.CurrentPitStallTimeSeconds = 0; + } + } + } + else + { + // We already were in our pit stall + this.CurrentPitStallTimeSeconds = time - this.PitStallEntryTime.Value; + + if (!this.InPitStall) + { + // We have now left our pit stall + + this.LastPitStallTimeSeconds = time - this.PitStallEntryTime.Value; + + this.CurrentPitStallTimeSeconds = 0; + + if (this.PitStallExitTime != null) + { + var diff = this.PitStallExitTime.Value - time; + if (Math.Abs(diff) < 5) + { + // Sim detected pit stall exit again less than 5 seconds after previous exit. + // This is not possible? + return; + } + } + + // Did we already count this stop? + if (!_hasIncrementedCounter) + { + // Now increment pitstop count + this.Pitstops += 1; + _hasIncrementedCounter = true; + } + + this.LastPitLap = _driver.Results.Current.LapsComplete; + this.CurrentStint = 0; + + // Reset + this.PitStallEntryTime = null; + this.PitStallExitTime = time; + } + } + + if (!this.InPitLane) + { + // We have now left pitlane + this.PitLaneExitTime = time; + _hasIncrementedCounter = false; + + this.LastPitLaneTimeSeconds = this.PitLaneExitTime.Value - this.PitLaneEntryTime.Value; + this.CurrentPitLaneTimeSeconds = 0; + + Sim.Instance.NotifyPitstop(RaceEvent.EventTypes.PitExit, _driver); + + // Reset + this.PitLaneEntryTime = null; + } + } + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverPrivateInfo.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverPrivateInfo.cs new file mode 100644 index 0000000..94fa071 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverPrivateInfo.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using iRacingSdkWrapper; + +namespace iRacingSimulator.Drivers +{ + public class DriverPrivateInfo + { + public DriverPrivateInfo(Driver driver) + { + _driver = driver; + } + + private readonly Driver _driver; + + public Driver Driver + { + get { return _driver; } + } + + public double Speed { get; private set; } + public float Throttle { get; private set; } + public float Brake { get; private set; } + public float Clutch { get; private set; } + + public float Fuel { get; private set; } + public float FuelPercentage { get; private set; } + public float FuelPressure { get; private set; } + + public void ParseTelemetry(TelemetryInfo e) + { + this.Speed = e.Speed.Value; + this.Throttle = e.Throttle.Value; + this.Brake = e.Brake.Value; + this.Clutch = e.Clutch.Value; + this.Fuel = e.FuelLevel.Value; + this.FuelPercentage = e.FuelLevelPct.Value; + this.FuelPressure = e.FuelPress.Value; + + // TODO: add remaining parameters + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverQualyResults.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverQualyResults.cs new file mode 100644 index 0000000..e73aee5 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverQualyResults.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using iRacingSdkWrapper; + +namespace iRacingSimulator.Drivers +{ + public class DriverQualyResults + { + public DriverQualyResults(Driver driver) + { + _driver = driver; + } + + private readonly Driver _driver; + /// + /// Gets the driver object. + /// + public Driver Driver { get { return _driver; } } + + public int Position { get; set; } + public int ClassPosition { get; set; } + public Laptime Lap { get; set; } + + internal void ParseYaml(YamlQuery query, int position) + { + this.Position = position + 1; + this.ClassPosition = Parser.ParseInt(query["ClassPosition"].GetValue()) + 1; + this.Lap = new Laptime(Parser.ParseFloat(query["FastestTime"].GetValue())); + this.Lap.LapNumber = Parser.ParseInt(query["FastestLap"].GetValue()); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverResults.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverResults.cs new file mode 100644 index 0000000..9ef45bd --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/DriverResults.cs @@ -0,0 +1,187 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using iRacingSdkWrapper; + +namespace iRacingSimulator.Drivers +{ + /// + /// Represents a dictionary of session results for a driver. Contains results for all sessions. + /// + public class DriverResults + { + private int _currentSessionNumber; + + public DriverResults(Driver driver) + { + _driver = driver; + _sessions = new Dictionary(); + } + + private readonly Dictionary _sessions; + /// + /// Gets the dictionary of session results for this driver. + /// + public Dictionary Sessions { get { return _sessions; } } + + private readonly Driver _driver; + /// + /// Gets the driver object. + /// + public Driver Driver { get { return _driver; } } + + /// + /// Checks if this driver is present in the results for the specified session. + /// + public bool HasResult(int sessionNumber) + { + return _sessions.ContainsKey(sessionNumber); + } + + internal void SetResults(int sessionNumber, YamlQuery query, int position) + { + if (!this.HasResult(sessionNumber)) + { + _sessions.Add(sessionNumber, new DriverSessionResults(_driver, sessionNumber)); + } + _currentSessionNumber = sessionNumber; + var results = this[sessionNumber]; + + results.ParseYaml(query, position); + } + + /// + /// Gets the session results for this driver for the specified session number, or empty results if he does not appear in the results. + /// + public DriverSessionResults FromSession(int sessionNumber) + { + if (this.HasResult(sessionNumber)) return _sessions[sessionNumber]; + return new DriverSessionResults(_driver, sessionNumber); + } + + /// + /// Gets the session results for this driver for the specified session number, or empty results if he does not appear in the results. + /// + public DriverSessionResults this[int sessionNumber] + { + get { return this.FromSession(sessionNumber); } + } + + public DriverSessionResults Current + { + get { return this.FromSession(_currentSessionNumber); } + } + } + + /// + /// Represents the session results for a single driver in a single session. + /// + [Serializable] + public class DriverSessionResults + { + public DriverSessionResults(Driver driver, int sessionNumber) + { + _driver = driver; + _sessionNumber = sessionNumber; + + this.Laps = new LaptimeCollection(); + this.IsEmpty = true; + + this.FakeSectorTimes = new[] + { + new Sector() {Number = 0, StartPercentage = 0f}, + new Sector() {Number = 1, StartPercentage = 0.333f}, + new Sector() {Number = 2, StartPercentage = 0.666f} + }; + } + + private readonly Driver _driver; + public Driver Driver { get { return _driver; } } + + private readonly int _sessionNumber; + public int SessionNumber { get { return _sessionNumber; } } + + public bool IsEmpty { get; set; } + + public int Position { get; set; } + public int ClassPosition { get; set; } + + public int Lap { get; set; } + public Laptime Time { get; set; } + + public int FastestLap { get; set; } + public Laptime FastestTime { get; set; } + public Laptime LastTime { get; set; } + public Laptime AverageTime { get; set; } + public int LapsLed { get; set; } + public int LapsComplete { get; set; } + public int LapsDriven { get; set; } + + public LaptimeCollection Laps { get; set; } + + public Sector[] SectorTimes { get; set; } + public Sector[] FakeSectorTimes { get; set; } + + public string SectorsDisplay + { + get + { + if (SectorTimes == null || SectorTimes.Length == 0) return "-"; + return string.Join(", ", SectorTimes.Select(s => s.SectorTime == null || s.SectorTime.Value == 0 ? "0.00" : s.SectorTime.DisplayShort)); + } + } + + public Sector FakeSector1 + { + get { return FakeSectorTimes == null || FakeSectorTimes.Length == 0 ? null : FakeSectorTimes[0]; } + } + + public Sector FakeSector2 + { + get { return FakeSectorTimes == null || FakeSectorTimes.Length == 0 ? null : FakeSectorTimes[1]; } + } + + public Sector FakeSector3 + { + get { return FakeSectorTimes == null || FakeSectorTimes.Length == 0 ? null : FakeSectorTimes[2]; } + } + + public int Incidents { get; set; } + public string OutReason { get; set; } + public int OutReasonId { get; set; } + public bool IsOut { get { return this.OutReasonId != 0; } } + + internal void ParseYaml(YamlQuery query, int position) + { + this.IsEmpty = false; + + this.Position = position; + this.ClassPosition = Parser.ParseInt(query["ClassPosition"].GetValue()) + 1; + + this.Lap = Parser.ParseInt(query["Lap"].GetValue()); + this.Time = new Laptime(Parser.ParseFloat(query["Time"].GetValue())); + this.FastestLap = Parser.ParseInt(query["FastestLap"].GetValue()); + this.FastestTime = new Laptime(Parser.ParseFloat(query["FastestTime"].GetValue())); + this.LastTime = new Laptime(Parser.ParseFloat(query["LastTime"].GetValue())); + this.LapsLed = Parser.ParseInt(query["LapsLed"].GetValue()); + + var previousLaps = this.LapsComplete; + this.LapsComplete = Parser.ParseInt(query["LapsComplete"].GetValue()); + this.LapsDriven = Parser.ParseInt(query["LapsDriven"].GetValue()); + + this.FastestTime.LapNumber = this.FastestLap; + this.LastTime.LapNumber = this.LapsComplete; + + // Check if a new lap is completed, and add it to Laps + if (this.LapsComplete > previousLaps) + { + this.Laps.Add(this.LastTime); + this.AverageTime = this.Laps.Average(); + } + + this.Incidents = Parser.ParseInt(query["Incidents"].GetValue());; + this.OutReasonId = Parser.ParseInt(query["ReasonOutId"].GetValue()); + this.OutReason = query["ReasonOutStr"].GetValue(); + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Drivers/License.cs b/iRacingSdkWrapper/iRacingSimulator/Drivers/License.cs new file mode 100644 index 0000000..1520002 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Drivers/License.cs @@ -0,0 +1,185 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Windows.Media; + +namespace iRacingSimulator.Drivers +{ + [Serializable] + public class License + { + private Color _backgroundColor; + + public License(int level, int sublevel, Color licenseColor) + { + this.SafetyRating = sublevel / 100f; + this.Level = this.GetLevel(level); + this.SortOrder = ((int)this.Level.Level) * 1000 + sublevel; + + this.BackgroundColor = licenseColor; + } + + public LicenseLevel Level { get; set; } + public LicenseLevel.Licenses LevelType { get { return this.Level.Level; }} + + public string Name { get { return this.Level.Name; } } + public float SafetyRating { get; set; } + public int SortOrder { get; set; } + + public Color BackgroundColor + { + get + { + if (this.Level.BackgroundOverride != null) return this.Level.BackgroundOverride.Value; + return _backgroundColor; + } + set { _backgroundColor = value; } + } + + public Color TextColor { get { return this.Level.TextColor; } } + + public string Display + { + get + { + string level; + if (this.Level.Level == LicenseLevel.Licenses.Unknown) + level = "?"; + else + level = this.Level.Display; + + return string.Format("{0} {1:0.00}", level, this.SafetyRating); + } + } + + public override string ToString() + { + return this.Display; + } + + private LicenseLevel GetLevel(int level) + { + return LicenseLevel.FromLevel(level); + } + + [Serializable] + public abstract class LicenseLevel + { + protected LicenseLevel(Licenses level, int lowRange, int highRange, Color? textBrush = null, string display = null) + { + this.Level = level; + this.Name = level.ToString(); + this.Display = string.IsNullOrWhiteSpace(display) ? this.Name.Substring(0, 1) : display; + this.LowRange = lowRange; + this.HighRange = highRange; + this.TextColor = textBrush ?? Colors.White; + this.BackgroundOverride = null; + } + + public Licenses Level { get; protected set; } + public string Name { get; protected set; } + public string Display { get; protected set; } + public int LowRange { get; protected set; } + public int HighRange { get; protected set; } + public Color TextColor { get; set; } + public Color? BackgroundOverride { get; set; } + + [Serializable] + public enum Licenses + { + R = 0, + D, + C, + B, + A, + P, + WC, + Unknown + } + + private static List _licenseLevels; + + static LicenseLevel() + { + _licenseLevels = new List(new LicenseLevel[] + { + new LicenseRookie(), + new LicenseD(), + new LicenseC(), + new LicenseB(), + new LicenseA(), + new LicensePro(), + new LicenseProWC(), + new LicenseUnknown() + }); + } + + public static LicenseLevel FromLevel(int level) + { + var license = _licenseLevels.SingleOrDefault(l => l.LowRange <= level && l.HighRange >= level); + if (license == null) return _licenseLevels.Last(); // unknown + return license; + } + } + + public class LicenseRookie : LicenseLevel + { + public LicenseRookie() + : base(Licenses.R, 0, 4) + { } + } + + public class LicenseD : LicenseLevel + { + public LicenseD() + : base(Licenses.D, 5, 8, Colors.Black) + { } + } + + public class LicenseC : LicenseLevel + { + public LicenseC() + : base(Licenses.C, 9, 12, Colors.Black) + { } + } + + public class LicenseB : LicenseLevel + { + public LicenseB() + : base(Licenses.B, 13, 16) + { } + } + + public class LicenseA : LicenseLevel + { + public LicenseA() + : base(Licenses.A, 17, 20) + { } + } + + public class LicensePro : LicenseLevel + { + public LicensePro() + : base(Licenses.P, 21, 24, Colors.White) + { + this.BackgroundOverride = Colors.Black; + } + } + + public class LicenseProWC : LicenseLevel + { + public LicenseProWC() + : base(Licenses.WC, 25, 28, Colors.Black, "WC") + { } + } + + public class LicenseUnknown : LicenseLevel + { + public LicenseUnknown() + : base(Licenses.Unknown, -1, -1, Colors.Black, "?") + { + this.BackgroundOverride = Colors.DarkGray; + } + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Events/RaceEvent.cs b/iRacingSdkWrapper/iRacingSimulator/Events/RaceEvent.cs new file mode 100644 index 0000000..20b8344 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Events/RaceEvent.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using iRacingSimulator.Drivers; + +namespace iRacingSimulator.Events +{ + /// + /// Represents a generic event during the race. + /// + public abstract class RaceEvent + { + protected RaceEvent() + { + this.Time = DateTime.UtcNow; + } + + /// + /// The time (UTC) of the event. + /// + public DateTime Time { get; set; } + + /// + /// The iRacing session time of the event. + /// + public double SessionTime { get; set; } + + /// + /// The lap of the event. + /// + public int Lap { get; set; } + + /// + /// The type of event. + /// + public abstract EventTypes Type { get; } + + public enum EventTypes + { + None = 0, + GreenFlag = 1, + YellowFlag = 2, + Winner = 3, + //PositionChange = 4, + NewLeader = 5, + BestLap = 6, + DriverSwap = 7, + PitEntry = 8, + PitExit = 9 + } + } + + /// + /// Represents a generic event concerning a single driver. + /// + public abstract class DriverRaceEvent : RaceEvent + { + public Driver Driver { get; set; } + } + + /// + /// Represents a generic event concerning a set of two drivers. + /// + public abstract class DriverSetRaceEvent : RaceEvent + { + public Driver Driver1 { get; set; } + public Driver Driver2 { get; set; } + + public override EventTypes Type { get { return EventTypes.DriverSwap;} } + } + + public class GreenFlagRaceEvent : RaceEvent + { + public override EventTypes Type { get { return EventTypes.GreenFlag; } } + } + + public class YellowFlagRaceEvent : RaceEvent + { + public override EventTypes Type { get { return EventTypes.YellowFlag; } } + } + + public class WinnerRaceEvent : DriverRaceEvent + { + public override EventTypes Type { get { return EventTypes.Winner; } } + } + +// public class PositionChangeRaceEvent : DriverSetRaceEvent +// { +// public override EventTypes Type { get { return EventTypes.PositionChange; } } +// } + + public class NewLeaderRaceEvent : DriverRaceEvent + { + public override EventTypes Type { get { return EventTypes.NewLeader; } } + } + + public class BestLapRaceEvent : DriverRaceEvent + { + public BestLap BestLap { get; set; } + + public override EventTypes Type { get { return EventTypes.BestLap; } } + } + + public class DriverSwapRaceEvent : DriverRaceEvent + { + public int PreviousDriverId { get; set; } + public string PreviousDriverName { get; set; } + + public int CurrentDriverId { get; set; } + public string CurrentDriverName { get; set; } + + public override EventTypes Type { get { return EventTypes.DriverSwap; } } + } + + public class PitEntryRaceEvent : DriverRaceEvent + { + public override EventTypes Type { get { return EventTypes.PitEntry; } } + } + + public class PitExitRaceEvent : DriverRaceEvent + { + public override EventTypes Type { get { return EventTypes.PitExit; } } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Laptime.cs b/iRacingSdkWrapper/iRacingSimulator/Laptime.cs new file mode 100644 index 0000000..12dc560 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Laptime.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using iRacingSimulator.Drivers; + +namespace iRacingSimulator +{ + public class Laptime + { + public Laptime() : this(0) + { + this.Time = TimeSpan.MaxValue; + } + + public Laptime(int value) + { + this.Value = value; + this.Time = TimeSpan.FromMilliseconds(value); + } + + public Laptime(float seconds) + : this((int)(seconds * 1000f)) + { + } + + public int Value { get; set; } + public TimeSpan Time { get; set; } + public int LapNumber { get; set; } + + /// + /// Formats a positive laptime in mm:sss.fff format. Use 'DiffDisplay' for displaying negative (differences in) laptimes. + /// + public string Display + { + get + { + if (this.Value <= 0 || this.Time == TimeSpan.MaxValue) return "-:--"; + return DiffDisplay; + } + } + + /// + /// Formats a (difference in) laptimes in mm:sss.fff format. Works for negative laptimes too. + /// + public string DiffDisplay + { + get + { + bool isNeg = this.Value < 0; + var time = this.Time; + if (isNeg) time = this.Time.Negate(); + + if (this.Time.Minutes > 0) + return string.Format("{0}{1:0}:{2:00}.{3:000}", isNeg ? "-": "", time.Minutes, time.Seconds, time.Milliseconds); + return string.Format("{0}{1:00}.{2:000}", isNeg ? "-" : "", time.Seconds, time.Milliseconds); + } + } + + public string DisplayShort + { + get + { + if (this.Value <= 0) return "-:--"; + + int precision = 1; + const int TIMESPAN_SIZE = 7; + int factor = (int) Math.Pow(10, (TIMESPAN_SIZE - precision)); + var rounded = new TimeSpan(((long)Math.Round((1.0 * this.Time.Ticks / factor)) * factor)); + + if (rounded.Minutes > 0) + { + var min = rounded.Minutes; + var sec = rounded.TotalSeconds - 60*min; + return string.Format("{0}:{1:00.0}", min, sec); + } + else + { + var sec = rounded.TotalSeconds; + return string.Format("{0:0.0}", sec); + } + } + } + + public static Laptime Empty + { + get + { + return new Laptime(0); + } + } + } + + public class LaptimeCollection : List + { + public Laptime Average() + { + var validLaps = this.Where(l => l.Value > 0).ToList(); + if (validLaps.Count == 0) return Laptime.Empty; + var averageMs = (int) validLaps.Average(l => l.Value); + return new Laptime(averageMs); + } + } + + public class BestLap + { + public BestLap(Laptime lap, Driver driver) + { + this.Laptime = lap; + + this.DriverId = driver.CustId; + this.DriverName = driver.Name; + this.DriverNumber = driver.CarNumber; + this.DriverTeamId = driver.TeamId; + this.DriverTeamName = driver.TeamName; + } + + public Laptime Laptime { get; private set; } + + public int DriverId { get; set; } + public string DriverName { get; set; } + public string DriverNumber { get; set; } + public int DriverTeamId { get; set; } + public string DriverTeamName { get; set; } + + public static BestLap Default + { + get + { + var lap = new Laptime(int.MaxValue); + lap.LapNumber = 0; + return new BestLap(lap, new Driver()); + } + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Parser.cs b/iRacingSdkWrapper/iRacingSimulator/Parser.cs new file mode 100644 index 0000000..e47e3e8 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Parser.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; + +namespace iRacingSimulator +{ + public static class Parser + { + public static double ParseTrackLength(string value) + { + // value = "6.93 km" + double length = 0; + + var indexOfKm = value.IndexOf("km"); + if (indexOfKm > 0) value = value.Substring(0, indexOfKm); + + if (double.TryParse(value, NumberStyles.AllowDecimalPoint | NumberStyles.AllowTrailingWhite, CultureInfo.InvariantCulture, out length)) + { + return length; + } + return 0; + } + + public static int ParseInt(string value, int @default = 0) + { + int val; + if (int.TryParse(value, out val)) return val; + return @default; + } + + public static float ParseFloat(string value, float @default = 0f) + { + float val; + if (float.TryParse(value, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingSign | NumberStyles.AllowTrailingWhite, + CultureInfo.InvariantCulture, out val)) return val; + return @default; + } + + public static double ParseSec(string value) + { + // value = "600.00 sec" + double length = 0; + + var indexOfSec = value.IndexOf(" sec"); + if (indexOfSec > 0) value = value.Substring(0, indexOfSec); + + if (double.TryParse(value, NumberStyles.AllowDecimalPoint | NumberStyles.AllowTrailingWhite, CultureInfo.InvariantCulture, out length)) + { + return length; + } + return 0; + } + + public static Color ParseColor(string value) + { + if (!string.IsNullOrWhiteSpace(value) && value.StartsWith("0x")) + { + try + { + var hex = value.Replace("0x", "#"); + //int argb = Int32.Parse(hex.Replace("#", ""), NumberStyles.HexNumber); + return (Color)ColorConverter.ConvertFromString(hex); + } + catch (Exception) + { + } + } + + return Colors.White; + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/iRacingSimulator/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7ba93e8 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("iRacingSimulator")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("iRacingSimulator")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("72e73265-1387-4b24-bde6-b94acaebdec9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/iRacingSimulator/Sector.cs b/iRacingSdkWrapper/iRacingSimulator/Sector.cs new file mode 100644 index 0000000..3342e55 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Sector.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace iRacingSimulator +{ + public class Sector + { + public int Number { get; set; } + public float StartPercentage { get; set; } + + public double EnterSessionTime { get; set; } + public Laptime SectorTime { get; set; } + + public Sector Copy() + { + var s = new Sector(); + s.Number = this.Number; + s.StartPercentage = this.StartPercentage; + return s; + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/SessionData.cs b/iRacingSdkWrapper/iRacingSimulator/SessionData.cs new file mode 100644 index 0000000..94fc198 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/SessionData.cs @@ -0,0 +1,111 @@ +using System.Collections.Generic; +using System.Linq; +using iRacingSdkWrapper; +using iRacingSdkWrapper.Bitfields; +using iRacingSimulator.Drivers; + +namespace iRacingSimulator +{ + public class SessionData + { + public SessionData() + { + this.ClassBestLaps = new Dictionary(); + } + + public Track Track { get; set; } + public string EventType { get; set; } + public string SessionType { get; set; } + public int SubsessionId { get; set; } + + public double SessionTime { get; set; } + public double TimeRemaining { get; set; } + public int LeaderLap { get; set; } + + public bool TrackCleanup { get; set; } + public bool DynamicTrack { get; set; } + public TrackConditions.TrackUsageTypes TrackUsage { get; set; } + public string TrackUsageText { get; set; } + + public string RaceLaps { get; set; } + public double RaceTime { get; set; } + + public Dictionary ClassBestLaps { get; set; } + public BestLap OverallBestLap { get; set; } + + public SessionFlag Flags { get; set; } + public SessionStates State { get; set; } + + /// + /// Is the checkered flag shown? (e.g. winner has passed the finish, but other drivers may still be racing) + /// + public bool IsCheckered { get; set; } + + /// + /// Is the session finished? (e.g. all drivers have finished and session is in cool-down) + /// + public bool IsFinished { get; set; } + + public void Update(SessionInfo info) + { + this.Track = Track.FromSessionInfo(info); + + var weekend = info["WeekendInfo"]; + this.SubsessionId = Parser.ParseInt(weekend["SubSessionID"].GetValue()); + this.EventType = weekend["EventType"].GetValue(); + + var session = info["SessionInfo"]["Sessions"]["SessionNum", Sim.Instance.CurrentSessionNumber]; + this.SessionType = session["SessionType"].GetValue(); + + this.TrackUsageText = session["SessionTrackRubberState"].GetValue(); + this.TrackUsage = TrackConditions.TrackUsageFromString(this.TrackUsageText); + + this.TrackCleanup = weekend["TrackCleanup"].GetValue() == "1"; + this.DynamicTrack = weekend["TrackDynamicTrack"].GetValue() == "1"; + + var laps = session["SessionLaps"].GetValue(); + var time = Parser.ParseSec(session["SessionTime"].GetValue()); + + this.RaceLaps = laps; + this.RaceTime = time; + } + + public void Update(TelemetryInfo telemetry) + { + this.SessionTime = telemetry.SessionTime.Value; + this.TimeRemaining = telemetry.SessionTimeRemain.Value; + this.Flags = telemetry.SessionFlags.Value; + } + + public void UpdateState(SessionStates state) + { + this.State = state; + this.IsFinished = state == SessionStates.CoolDown; + this.IsCheckered = (state == SessionStates.CoolDown || state == SessionStates.Checkered); + } + + public BestLap UpdateFastestLap(Laptime lap, Driver driver) + { + var classId = driver.Car.CarClassId; + if (!this.ClassBestLaps.ContainsKey(classId)) + { + this.ClassBestLaps.Add(classId, BestLap.Default); + } + + if (lap.Value > 0 && this.ClassBestLaps[classId].Laptime.Value > lap.Value) + { + var bestlap = new BestLap(lap, driver); + this.ClassBestLaps[classId] = bestlap; + + this.OverallBestLap = + this.ClassBestLaps.Values.Where(l => l.Laptime.Value > 0) + .OrderBy(l => l.Laptime.Value) + .FirstOrDefault(); + + return bestlap; + } + return null; + } + + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Sim.cs b/iRacingSdkWrapper/iRacingSimulator/Sim.cs new file mode 100644 index 0000000..e228a8f --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Sim.cs @@ -0,0 +1,579 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using iRacingSdkWrapper; +using iRacingSdkWrapper.Bitfields; +using iRacingSimulator.Drivers; +using iRacingSimulator.Events; + +namespace iRacingSimulator +{ + public class Sim + { + private static Sim _instance; + public static Sim Instance + { + get { return _instance ?? (_instance = new Sim()); } + } + + private TelemetryInfo _telemetry; + private SessionInfo _sessionInfo; + + private bool _mustUpdateSessionData, _mustReloadDrivers; + private TimeDelta _timeDelta; + + private Sim() + { + _sdk = new SdkWrapper(); + _drivers = new List(); + + _sessionData = new SessionData(); + _mustUpdateSessionData = true; + + // Attach events + _sdk.Connected += SdkOnConnected; + _sdk.Disconnected += SdkOnDisconnected; + _sdk.TelemetryUpdated += SdkOnTelemetryUpdated; + _sdk.SessionInfoUpdated += SdkOnSessionInfoUpdated; + } + + #region Properties + + private readonly SdkWrapper _sdk; + public SdkWrapper Sdk { get { return _sdk; } } + + private int? _currentSessionNumber; + public int? CurrentSessionNumber { get { return _currentSessionNumber; } } + + public TelemetryInfo Telemetry { get { return _telemetry; } } + public SessionInfo SessionInfo { get { return _sessionInfo; } } + + private SessionData _sessionData; + public SessionData SessionData { get { return _sessionData; } } + + private Driver _driver; + public Driver Driver { get { return _driver; } } + + private Driver _leader; + public Driver Leader{ get { return _leader; } } + + private bool _isReplay; + public bool IsReplay { get { return _isReplay; } } + + #endregion + + #region Methods + + public void Start(double updateFrequency = 10) + { + this.Reset(); + _sdk.TelemetryUpdateFrequency = updateFrequency; + _sdk.Start(); + } + + public void Stop() + { + _sdk.Stop(); + this.Reset(); + } + + private void Reset() + { + _mustUpdateSessionData = true; + _mustReloadDrivers = true; + _currentSessionNumber = null; + _driver = null; + _leader = null; + _drivers.Clear(); + _timeDelta = null; + _telemetry = null; + _sessionInfo = null; + _isUpdatingDrivers = false; + } + + #region Drivers + + private readonly List _drivers; + public List Drivers { get { return _drivers; } } + + private bool _isUpdatingDrivers; + + private void UpdateDriverList(SessionInfo info) + { + Debug.WriteLine("UpdateDriverList"); + _isUpdatingDrivers = true; + this.GetDrivers(info); + _isUpdatingDrivers = false; + + this.GetResults(info); + } + + private void GetDrivers(SessionInfo info) + { + Debug.WriteLine("GetDrivers"); + if (_mustReloadDrivers) + { + Debug.WriteLine("MustReloadDrivers: true"); + _drivers.Clear(); + _mustReloadDrivers = false; + } + + // Assume max 70 drivers + for (int id = 0; id < 70; id++) + { + // Find existing driver in list + var driver = _drivers.SingleOrDefault(d => d.Id == id); + if (driver == null) + { + driver = Driver.FromSessionInfo(info, id); + + // If no driver found, end of list reached + if (driver == null) break; + + driver.IsCurrentDriver = false; + + // Add to list + _drivers.Add(driver); + } + else + { + // Update and check if driver swap occurred + var oldId = driver.CustId; + var oldName = driver.Name; + driver.ParseDynamicSessionInfo(info); + + if (oldId != driver.CustId) + { + var e = new DriverSwapRaceEvent(); + e.Driver = driver; + e.PreviousDriverId = oldId; + e.PreviousDriverName = oldName; + e.CurrentDriverId = driver.Id; + e.CurrentDriverName = driver.Name; + e.SessionTime = _telemetry.SessionTime.Value; + e.Lap = driver.Live.Lap; + + this.OnRaceEvent(e); + } + } + + if (_sdk.DriverId == driver.Id) + { + _driver = driver; + _driver.IsCurrentDriver = true; + } + } + } + + private void GetResults(SessionInfo info) + { + // If currently updating list, or no session yet, then no need to update result info + if (_isUpdatingDrivers) return; + if (_currentSessionNumber == null) return; + + this.GetQualyResults(info); + this.GetRaceResults(info); + } + + private void GetQualyResults(SessionInfo info) + { + // TODO: stop if qualy is finished + var query = + info["QualifyResultsInfo"]["Results"]; + + for (int position = 0; position < _drivers.Count; position++) + { + var positionQuery = query["Position", position]; + + string idValue; + if (!positionQuery["CarIdx"].TryGetValue(out idValue)) + { + // Driver not found + continue; + } + + // Find driver and update results + int id = int.Parse(idValue); + + var driver = _drivers.SingleOrDefault(d => d.Id == id); + if (driver != null) + { + driver.UpdateQualyResultsInfo(positionQuery, position); + } + } + } + + private void GetRaceResults(SessionInfo info) + { + var query = + info["SessionInfo"]["Sessions"]["SessionNum", _currentSessionNumber]["ResultsPositions"]; + + for (int position = 1; position <= _drivers.Count; position++) + { + var positionQuery = query["Position", position]; + + string idValue; + if (!positionQuery["CarIdx"].TryGetValue(out idValue)) + { + // Driver not found + continue; + } + + // Find driver and update results + int id = int.Parse(idValue); + + var driver = _drivers.SingleOrDefault(d => d.Id == id); + if (driver != null) + { + var previousPosition = driver.Results.Current.ClassPosition; + + driver.UpdateResultsInfo(_currentSessionNumber.Value, positionQuery, position); + + if (_telemetry != null) + { + // Check for new leader + if (previousPosition > 1 && driver.Results.Current.ClassPosition == 1) + { + var e = new NewLeaderRaceEvent(); + e.Driver = driver; + e.SessionTime = _telemetry.SessionTime.Value; + e.Lap = driver.Live.Lap; + + this.OnRaceEvent(e); + } + + // Check for new best lap + var bestlap = _sessionData.UpdateFastestLap(driver.CurrentResults.FastestTime, driver); + if (bestlap != null) + { + var e = new BestLapRaceEvent(); + e.Driver = driver; + e.BestLap = bestlap; + e.SessionTime = _telemetry.SessionTime.Value; + e.Lap = driver.Live.Lap; + + this.OnRaceEvent(e); + } + } + } + } + } + + private void ResetSession() + { + // Need to re-load all drivers when session info updates + _mustReloadDrivers = true; + } + + private void UpdateDriverTelemetry(TelemetryInfo info) + { + // If currently updating list, no need to update telemetry info + if (_isUpdatingDrivers) return; + + if (_driver != null) _driver.UpdatePrivateInfo(info); + foreach (var driver in _drivers) + { + driver.Live.CalculateSpeed(info, _sessionData.Track.Length); + driver.UpdateLiveInfo(info); + driver.UpdateSectorTimes(_sessionData.Track, info); + } + + this.CalculateLivePositions(); + this.UpdateTimeDelta(); + } + + private void CalculateLivePositions() + { + // In a race that is not yet in checkered flag mode, + // Live positions are determined from track position (total lap distance) + // Any other conditions (race finished, P, Q, etc), positions are ordered as result positions + + if (this.SessionData.EventType == "Race" && !this.SessionData.IsCheckered) + { + // Determine live position from lapdistance + int pos = 1; + foreach (var driver in _drivers.OrderByDescending(d => d.Live.TotalLapDistance)) + { + if (pos == 1) _leader = driver; + driver.Live.Position = pos; + pos++; + } + } + else + { + // In P or Q, set live position from result position (== best lap according to iRacing) + foreach (var driver in _drivers.OrderBy(d => d.Results.Current.Position)) + { + if (this.Leader == null) _leader = driver; + driver.Live.Position = driver.Results.Current.Position; + } + } + + // Determine live class position from live positions and class + // Group drivers in dictionary with key = classid and value = list of all drivers in that class + var dict = (from driver in _drivers + group driver by driver.Car.CarClassId) + .ToDictionary(d => d.Key, d => d.ToList()); + + // Set class position + foreach (var drivers in dict.Values) + { + var pos = 1; + foreach (var driver in drivers.OrderBy(d => d.Live.Position)) + { + driver.Live.ClassPosition = pos; + pos++; + } + } + + if (this.Leader != null && this.Leader.CurrentResults != null) + _sessionData.LeaderLap = this.Leader.CurrentResults.LapsComplete + 1; + } + + private void UpdateTimeDelta() + { + if (_timeDelta == null) return; + + // Update the positions of all cars + _timeDelta.Update(_telemetry.SessionTime.Value, _telemetry.CarIdxLapDistPct.Value); + + // Order drivers by live position + var drivers = _drivers.OrderBy(d => d.Live.Position).ToList(); + if (drivers.Count > 0) + { + // Get leader + //var leader = drivers[0]; + this.Leader.Live.DeltaToLeader = "-"; + this.Leader.Live.DeltaToNext = "-"; + + // Loop through drivers + for (int i = 1; i < drivers.Count; i++) + { + var behind = drivers[i]; + var ahead = drivers[i - 1]; + + // Lapped? + var leaderLapDiff = Math.Abs(this.Leader.Live.TotalLapDistance - behind.Live.TotalLapDistance); + var nextLapDiff = Math.Abs(ahead.Live.TotalLapDistance - behind.Live.TotalLapDistance); + + if (leaderLapDiff < 1) + { + var leaderDelta = _timeDelta.GetDelta(behind.Id, this.Leader.Id); + behind.Live.DeltaToLeader = TimeDelta.DeltaToString(leaderDelta); + } + else + { + behind.Live.DeltaToLeader = Math.Floor(leaderLapDiff) + " L"; + } + + if (nextLapDiff < 1) + { + var nextDelta = _timeDelta.GetDelta(behind.Id, ahead.Id); + behind.Live.DeltaToNext = TimeDelta.DeltaToString(nextDelta); + } + else + { + behind.Live.DeltaToNext = Math.Floor(nextLapDiff) + " L"; + } + } + } + } + + private void CheckSessionFlagUpdates(SessionFlag prevFlags, SessionFlag curFlags) + { + if (prevFlags == null || curFlags == null) return; + + var go = SessionFlags.StartGo; + var green = SessionFlags.Green; + var yellow = SessionFlags.Caution; + + bool isGreen = !prevFlags.Contains(go) && curFlags.Contains(go) + || !prevFlags.Contains(green) && curFlags.Contains(green); + + if (isGreen) + { + var e= new GreenFlagRaceEvent(); + e.SessionTime = _telemetry.SessionTime.Value; + e.Lap = Leader == null ? 0 : Leader.Live.Lap; + this.OnRaceEvent(e); + } + + if (!prevFlags.Contains(yellow) && curFlags.Contains(yellow)) + { + var e = new YellowFlagRaceEvent(); + e.SessionTime = _telemetry.SessionTime.Value; + e.Lap = Leader == null ? 0 : Leader.Live.Lap; + this.OnRaceEvent(e); + } + } + + public void NotifyPitstop(RaceEvent.EventTypes type, Driver driver) + { + DriverRaceEvent e; + if (type == Events.RaceEvent.EventTypes.PitEntry) + e = new PitEntryRaceEvent(); + else + e = new PitExitRaceEvent(); + + e.Driver = driver; + e.SessionTime = _telemetry.SessionTime.Value; + e.Lap = driver.Live.Lap; + this.OnRaceEvent(e); + } + + #endregion + + #region Events + + private void SdkOnSessionInfoUpdated(object sender, SdkWrapper.SessionInfoUpdatedEventArgs e) + { + Debug.WriteLine($"SdkOnSessionInfoUpdated: {e.UpdateTime}"); + + // Cache info + _sessionInfo = e.SessionInfo; + + // Stop if we don't have a session number yet + if (_currentSessionNumber == null) return; + + if (_mustUpdateSessionData) + { + _sessionData.Update(e.SessionInfo); + _timeDelta = new TimeDelta((float)_sessionData.Track.Length * 1000f, 20, 64); + _mustUpdateSessionData = false; + + this.OnStaticInfoChanged(); + } + + // Update drivers + this.UpdateDriverList(e.SessionInfo); + + this.OnSessionInfoUpdated(e); + } + + private void SdkOnTelemetryUpdated(object sender, SdkWrapper.TelemetryUpdatedEventArgs e) + { + // Cache info + _telemetry = e.TelemetryInfo; + + _isReplay = e.TelemetryInfo.IsReplayPlaying.Value; + + // Check if session changed + if (_currentSessionNumber == null || (_currentSessionNumber.Value != e.TelemetryInfo.SessionNum.Value)) + { + _mustUpdateSessionData = true; + + // Session changed, reset session info + this.ResetSession(); + } + + // Store current session number + _currentSessionNumber = e.TelemetryInfo.SessionNum.Value; + + // Get previous state + var sessionWasFinished = this.SessionData.IsFinished; + var prevFlags = this.SessionData.Flags; + + // Update session state + _sessionData.UpdateState(e.TelemetryInfo.SessionState.Value); + + // Update drivers telemetry + this.UpdateDriverTelemetry(e.TelemetryInfo); + + // Update session data + this.SessionData.Update(e.TelemetryInfo); + + // Check if flags updated + this.CheckSessionFlagUpdates(prevFlags, this.SessionData.Flags); + + if (!sessionWasFinished && this.SessionData.IsFinished) + { + // If session just finished, get winners + // Use result position (not live position) + var winners = + Drivers.Where(d => d.CurrentResults != null && d.CurrentResults.ClassPosition == 1).OrderBy(d => d.CurrentResults.Position); + foreach (var winner in winners) + { + var ev = new WinnerRaceEvent(); + ev.Driver = winner; + ev.SessionTime = _telemetry.SessionTime.Value; + ev.Lap = winner.Live.Lap; + this.OnRaceEvent(ev); + } + } + this.OnTelemetryUpdated(e); + } + + private void SdkOnDisconnected(object sender, EventArgs e) + { + this.Reset(); + this.OnDisconnected(); + } + + private void SdkOnConnected(object sender, EventArgs e) + { + this.OnConnected(); + } + + public event EventHandler Connected; + public event EventHandler Disconnected; + public event EventHandler StaticInfoChanged; + public event EventHandler SessionInfoUpdated; + public event EventHandler TelemetryUpdated; + public event EventHandler SimulationUpdated; + public event EventHandler RaceEvent; + + protected virtual void OnConnected() + { + if (this.Connected != null) this.Connected(this, EventArgs.Empty); + } + + protected virtual void OnDisconnected() + { + if (this.Disconnected != null) this.Disconnected(this, EventArgs.Empty); + } + + protected virtual void OnStaticInfoChanged() + { + if (this.StaticInfoChanged != null) this.StaticInfoChanged(this, EventArgs.Empty); + } + + protected virtual void OnSessionInfoUpdated(SdkWrapper.SessionInfoUpdatedEventArgs e) + { + if (this.SessionInfoUpdated != null) this.SessionInfoUpdated(this, e); + } + + protected virtual void OnTelemetryUpdated(SdkWrapper.TelemetryUpdatedEventArgs e) + { + if (this.TelemetryUpdated != null) this.TelemetryUpdated(this, e); + } + + protected virtual void OnSimulationUpdated() + { + if (this.SimulationUpdated != null) this.SimulationUpdated(this, EventArgs.Empty); + } + + protected virtual void OnRaceEvent(RaceEvent @event) + { + if (this.RaceEvent != null) this.RaceEvent(this, new RaceEventArgs(@event)); + } + + public class RaceEventArgs : EventArgs + { + public RaceEventArgs(RaceEvent @event) + { + _event = @event; + } + + private readonly RaceEvent _event; + public RaceEvent Event { get { return _event; } } + } + + #endregion + + #endregion + + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/TimeDelta.cs b/iRacingSdkWrapper/iRacingSimulator/TimeDelta.cs new file mode 100644 index 0000000..6aadc16 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/TimeDelta.cs @@ -0,0 +1,324 @@ +/* + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + * + * TimeDelta class + * Calculates time difference between two drivers or previously recorded best lap + * + * Constants: + * Int32 maxcars: length of track positions array + * Int32 splitdistance: split length, too low value will skip splits with fast cars + * and too big will reduce update rate. 10 meters is a good start value. + * + * Interfaces: + * TimeDelta(Single length) + * Class constructor + * Parameters: + * length: Track length in some format, see splitdistance constant + * + * Update(Double timestamp, Double[] trackPosition) + * Update(Double timestamp, Single[] trackPosition) + * Updates data using timestamp and car positions. Also handles best lap if car + * id is set, see SaveBestLap(). + * Parameters: + * timestamp: increasing timestamp + * trackPosition: array of car positions indexed with car ids + * + * SaveBestLap(Int32 caridx) + * Sets player's car id, which will be followed and best lap will be saved for + * comparison. Set -1 to disable. + * Parameters: + * caridx: car id for car to be followed + * + * GetBestLapDelta(Double trackPosition) + * GetBestLapDelta(Single trackPosition) + * Gets delta to previously saved best lap + * Parameters: + * trackPosition: Current trackposition to which best lap is compared to. + * Uses data from Update()-function to calculate current laptime. + * + * GetDelta(Int32 caridx1, Int32 caridx2) + * Gets delta between two cars, doesn't take care if drivers are lapped. + * Returns time of caridx1-caridx2 + * Parameters: + * caridx1: First driver car id (car behind) + * caridx2: Second driver car id (car infront) + * + * BestLap + * Gets lap time of best lap +*/ + +using System; +using System.IO; +using System.IO.Compression; + +namespace iRacingSimulator +{ + public class TimeDelta + { + + private Single splitdistance = 20; + + private Int32 maxcars = 64; + private Double[][] splits = new Double[0][]; + private Int32[] splitPointer = new Int32[0]; + private Single splitLength; + private Double prevTimestamp; + private Int32 followed; + private Double[] bestlap; + private Double[] currentlap; + private Boolean validbestlap; + private Double lapstarttime; + private Int32 arraySize; + + public TimeDelta(Single length, Single splitdist, Int32 drivers) + { + // save split distance + this.splitdistance = splitdist; + + // save car count + maxcars = drivers; + // split times every 10 meters + arraySize = (Int32)Math.Round(length / splitdistance); + + // set split length + splitLength = (Single)(1.0 / (Double)arraySize); + + // init best lap + followed = -1; + bestlap = new Double[arraySize]; + currentlap = new Double[arraySize]; + validbestlap = false; + + // initialize array + splits = new Double[maxcars][]; + splitPointer = new Int32[maxcars]; + for (Int32 i = 0; i < maxcars; i++) + splits[i] = new Double[arraySize]; + } + + public void SaveBestLap(Int32 caridx) + { + followed = caridx; + } + + public TimeSpan BestLap { get { if (validbestlap) return new TimeSpan(0, 0, 0, (Int32)bestlap[bestlap.Length - 1], (Int32)((bestlap[bestlap.Length - 1] % 1) * 1000)); else return new TimeSpan(); } set { } } + + public void Update(Double timestamp, Single[] trackPosition) + { + Double[] temp = Array.ConvertAll(trackPosition, item => (Double)item); + Update(timestamp, temp); + } + + public void Update(Double timestamp, Double[] trackPosition) + { + // sanity check + if (timestamp > prevTimestamp) + { + Int32 currentSplitPointer; + + for (Int32 i = 0; i < trackPosition.Length; i++) + { + if (trackPosition[i] > 0) + { + // interpolate split border crossing + currentSplitPointer = (Int32)Math.Floor((trackPosition[i] % 1) / splitLength); + + if (currentSplitPointer != splitPointer[i]) + { + // interpolate + Double distance = trackPosition[i] - (currentSplitPointer * splitLength); + Double correction = distance / splitLength; + Double currentSplitTime = timestamp - ((timestamp - prevTimestamp) * correction); + Boolean newlap = false; + + if (currentSplitPointer < (100 / splitdistance) && splitPointer[i] > arraySize - (100 / splitdistance)) + newlap = true; + + // check if we need interpolation over zero values (splithop > 1) + Int32 splithop = currentSplitPointer - splitPointer[i]; + Double splitcumulator = (currentSplitTime - prevTimestamp) / splithop; + Int32 k = 1; + + // check if we crossed the s/f-line (2*10 split threshold, otherwise we miss it) + if (splithop < 0 && newlap) + { + splithop = arraySize - splitPointer[i] + currentSplitPointer; + + // in case it new best lap precalculate rest of the lap + if (followed >= 0 && i == followed) + { + for (Int32 j = splitPointer[i] + 1; j < arraySize; j++) + { + splits[i][j % arraySize] = splits[i][splitPointer[i]] + k++ * splitcumulator; + } + } + } + + // save in case of new lap record + if (followed >= 0 && i == followed) + { + // check new lap + if (newlap) + { + if ((currentSplitTime - splits[i][0]) < bestlap[bestlap.Length - 1] || bestlap[bestlap.Length - 1] == 0) + { + validbestlap = true; + // save lap and substract session time offset + for (Int32 j = 0; j < bestlap.Length - 1; j++) + { + bestlap[j] = splits[i][j + 1] - splits[i][0]; + if (splits[i][j + 1] == 0.0) + validbestlap = false; + } + + bestlap[bestlap.Length - 1] = currentSplitTime - splits[i][0]; + } + } + + lapstarttime = currentlap[currentSplitPointer]; + currentlap[currentSplitPointer] = currentSplitTime; + } + + // fill hopped sectors if necessary + if (splithop > 1) + { + k = 1; + for (Int32 j = splitPointer[i] + 1; j % arraySize != currentSplitPointer; j++) + { + splits[i][j % arraySize] = splits[i][splitPointer[i]] + (k++ * splitcumulator); + } + } + + // save + splits[i][currentSplitPointer] = currentSplitTime; + splitPointer[i] = currentSplitPointer; + } + } + } + prevTimestamp = timestamp; + } + } + + public TimeSpan GetBestLapDelta(Single trackPosition) + { + return GetBestLapDelta((Double)trackPosition); + } + + public TimeSpan GetBestLapDelta(Double trackPosition) + { + if (validbestlap) + { + Int32 currentSplitPointer = (Int32)Math.Floor((Math.Abs(trackPosition) % 1) / splitLength); + Double delta; + + if (currentSplitPointer == 0) + delta = (splits[followed][0] - lapstarttime) - bestlap[bestlap.Length - 1]; + else if (currentSplitPointer == (bestlap.Length - 1)) + delta = (splits[followed][currentSplitPointer] - lapstarttime) - bestlap[bestlap.Length - 1]; + else + delta = (splits[followed][currentSplitPointer] - splits[followed][bestlap.Length - 1]) - bestlap[currentSplitPointer - 1]; + + return new TimeSpan(0, 0, 0, (Int32)Math.Floor(delta), (Int32)Math.Abs((delta % 1) * 1000)); + } + else + { + return new TimeSpan(); + } + } + + public TimeSpan GetDelta(Int32 caridx1, Int32 caridx2) + { + // validate + if (caridx1 < maxcars && caridx2 < maxcars && caridx1 >= 0 && caridx2 >= 0) + { + // comparing latest finished split + Int32 comparedSplit = splitPointer[caridx1]; + + // catch negative index and loop it to last index + if (comparedSplit < 0) + comparedSplit = splits[caridx1].Length - 1; + + Double delta = splits[caridx1][comparedSplit] - splits[caridx2][comparedSplit]; + + //Console.WriteLine(prevTimestamp + " " + splits[caridx1][comparedSplit] + " " + splits[caridx2][comparedSplit]); + + if (splits[caridx1][comparedSplit] == 0 || splits[caridx2][comparedSplit] == 0) + return new TimeSpan(); + //else if (delta < 0) + // return new TimeSpan(); + else + return new TimeSpan(0, 0, 0, (Int32)Math.Floor(delta), (Int32)Math.Abs((delta % 1) * 1000)); + } + else + { + return new TimeSpan(); + } + } + + public static string DeltaToString(TimeSpan delta) + { + var seconds = delta.TotalSeconds; + var laptime = new Laptime((float)seconds); + return laptime.DisplayShort; + } + + public void StoreLap(String filename) + { + + FileStream file = File.Create(filename); + DeflateStream Compress = new DeflateStream(file, CompressionMode.Compress); + + Byte[] buf; + for (Int32 i = 0; i < bestlap.Length; i++) + { + buf = BitConverter.GetBytes(bestlap[i]); + Compress.Write(buf, 0, buf.Length); + } + + Compress.Close(); + file.Close(); + + } + + public void LoadLap(String filename) + { + if (File.Exists(filename)) + { + FileStream file = File.OpenRead(filename); + DeflateStream Compress = new DeflateStream(file, CompressionMode.Decompress); + Byte[] buf = new Byte[sizeof(Double)]; + Int32 arrPtr = 0; + Int32 retval = 0; + + do + { + retval = Compress.Read(buf, 0, sizeof(Double)); + if (arrPtr < bestlap.Length && retval > 0) + bestlap[arrPtr++] = BitConverter.ToDouble(buf, 0); + } while (retval > 0); + + if (arrPtr == bestlap.Length) + validbestlap = true; + else + { + validbestlap = false; + bestlap = new Double[arraySize]; + } + Compress.Close(); + file.Close(); + } + } + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/Track.cs b/iRacingSdkWrapper/iRacingSimulator/Track.cs new file mode 100644 index 0000000..c956544 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/Track.cs @@ -0,0 +1,66 @@ +using System.Collections.Generic; +using System.Globalization; +using iRacingSdkWrapper; + +namespace iRacingSimulator +{ + public class Track + { + private readonly List _sectors; + + public Track() + { + _sectors = new List(); + } + + public int Id { get; set; } + public string Name { get; set; } + public string CodeName { get; set; } + public double Length { get; set; } + public bool NightMode { get; set; } + + public List Sectors + { + get { return _sectors; } + } + + public static Track FromSessionInfo(SessionInfo info) + { + var track = new Track(); + + var query = info["WeekendInfo"]; + track.Id = Parser.ParseInt(query["TrackID"].GetValue()); + track.Name = query["TrackDisplayName"].GetValue(); + track.CodeName = query["TrackName"].GetValue(); + track.Length = Parser.ParseTrackLength(query["TrackLength"].GetValue()); + track.NightMode = query["WeekendOptions"]["NightMode"].GetValue() == "1"; + + // Parse sectors + track.Sectors.Clear(); + query = info["SplitTimeInfo"]["Sectors"]; + + int nr = 0; + while (nr >= 0) + { + var pctString = query["SectorNum", nr]["SectorStartPct"].GetValue(); + float pct; + if (string.IsNullOrWhiteSpace(pctString) || !float.TryParse(pctString, NumberStyles.AllowDecimalPoint, + CultureInfo.InvariantCulture, out pct)) + { + break; + } + + var sector = new Sector(); + sector.Number = nr; + sector.StartPercentage = pct; + track.Sectors.Add(sector); + + nr++; + } + + return track; + } + + + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/TrackConditions.cs b/iRacingSdkWrapper/iRacingSimulator/TrackConditions.cs new file mode 100644 index 0000000..57e3996 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/TrackConditions.cs @@ -0,0 +1,243 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace iRacingSimulator +{ + public class TrackConditions + { + public const float Tolerance = 0.1f; + public static readonly int DefaultWeatherType = 0; + public static readonly float DefaultAirDensity = 1.207f; + public static readonly float DefaultAirPressure = 29.34f; + public static readonly float DefaultAirTemp = 25.556f; // C + public static readonly int DefaultFogLevel = 0; + public static readonly float DefaultHumidity = 0.55f; + public static readonly int DefaultSkies = 1; + public static readonly float DefaultTrackTemp = 39.8f; // C + public static readonly float DefaultWindDir = 0; + public static readonly float DefaultWindVel = 0.894f; // m/s + public static readonly int DefaultTrackUsage = (int)TrackUsageTypes.ModeratelyLow; + public static readonly bool DefaultMarbleCleanup = true; + + public static readonly int MinTemperatureF = 65; // F + public static readonly int MaxTemperatureF = 90; // F + public static readonly int MaxWindSpeedMph = 30; // mph + public static readonly int MinTemperatureC = (int) TempToC(MinTemperatureF); + public static readonly int MaxTemperatureC = (int) TempToC(MaxTemperatureF); + public static readonly int MaxWindSpeedKph = (int) WindToKph(MaxWindSpeedMph); + + /// + /// Converts temperature from degrees Celsius to Fahrenheit + /// + /// Temperature in degrees Celsius + /// + public static float TempToF(float tempC) + { + return tempC * 1.8f + 32f; + } + + /// + /// Converts temperature from Fahrenheit to degrees Celsius + /// + /// Temperature in Fahrenheit + /// + public static float TempToC(float tempF) + { + return (tempF - 32)/1.8f; + } + + /// + /// Converts wind speed from meters/second to miles/hour. + /// + /// Wind speed in meters/second + /// + public static float WindToMph(float windMps) + { + return WindToMphFromKph(windMps * 3.6f); + } + + /// + /// Converts wind speed from kilometers/hour to miles/hour. + /// + /// Wind speed in kilometers/hour + /// + public static float WindToMphFromKph(float windKph) + { + return windKph* 0.6213712f; + } + + /// + /// Converts wind speed from miles/hour to kilometers/hour. + /// + /// Wind speed in miles/hour + /// + public static float WindToKph(float windMph) + { + return windMph / 0.6213712f; + } + + private static double WrapWindDir(double degrees) + { + while (degrees < 0) degrees += 360; + while (degrees > 360) degrees -= 360; + return degrees; + } + + /// + /// Converts wind direction from radians to degrees, optionally rounding to nearest "45-degree" cardinal direction (e.g. N, NE, E, SE, etc). + /// + /// Direction in radians + /// If true, rounds to nearest "45-degree" cardinal direction + /// + public static float WindDirToDegrees(float dirRadians, bool rounded = false) + { + var degrees = WrapWindDir(dirRadians*180/Math.PI); + if (rounded) + return (int) Math.Round(degrees/45f)*45f; + return (float)degrees; + } + + /// + /// Converts wind direction from degrees to radians. + /// + /// Direction in degrees (0 - 360) + /// + public static float WindDirToRadians(float dirDegrees) + { + var degrees = WrapWindDir(dirDegrees); + return (float) (degrees*Math.PI/180f); + } + + /// + /// Converts wind direction in radians to the name of the corresponding cardinal direction (e.g. N, NE, E, SE, etc). + /// + /// Direction in radians + /// + public static string WindDirToCardinal(float dirRadians) + { + var degrees = WindDirToDegrees(dirRadians); + + var step = 45/2f; + + if (degrees > 360 - step || degrees < step) + return "N"; + if (degrees < 45+step) + return "NE"; + if (degrees < 90+step) + return "E"; + if (degrees < 135 + step) + return "SE"; + if (degrees < 180 + step) + return "S"; + if (degrees < 225 + step) + return "SW"; + if (degrees < 270 + step) + return "W"; + return "NW"; + } + + /// + /// Converts wind direction in a string containing both the cardinal direction name (e.g. N, NE, E) and the actual direction in degrees. + /// + /// Direction in radians + /// + public static object WindDirToCardinalAndDegrees(float dirRadians) + { + var cardinal = WindDirToCardinal(dirRadians); + var degrees = WindDirToDegrees(dirRadians, false); + return string.Format("{0} ({1:0}°)", cardinal, degrees); + } + + /// + /// Converts sky type parameter (0-3) to corresponding sky type text (Clear, Partly Cloudy, etc). + /// + /// Sky type parameter (0 - 3) + /// + public static string SkiesFromValue(int value) + { + switch (value) + { + case 0: + return "Clear"; + case 1: + return "Partly cloudy"; + case 2: + return "Mostly cloudy"; + case 3: + return "Overcast"; + } + return "(Unknown)"; + } + + /// + /// Converts track usage session info string to TrackUsageTypes enum value. + /// + /// Track usage string from session info (e.g. "low usage") + /// + public static TrackUsageTypes TrackUsageFromString(string usage) + { + switch (usage.ToLower().Trim()) + { + case "clean": return TrackUsageTypes.Clean; + case "low usage": return TrackUsageTypes.Low; + case "slight usage": return TrackUsageTypes.Slight; + case "moderately low usage": return TrackUsageTypes.ModeratelyLow; + case "moderate usage": return TrackUsageTypes.Moderate; + case "moderately high usage": return TrackUsageTypes.ModeratelyHigh; + case "high usage": return TrackUsageTypes.High; + case "extensive usage": return TrackUsageTypes.Extensive; + case "maximum usage": return TrackUsageTypes.Maximum; + } + return TrackUsageTypes.Unknown; + } + + /// + /// Converts track usage value (from TrackUsageTypes enum) to display string (e.g. "low usage"). + /// + /// Track usage value + /// + public static string TrackUsageToString(TrackUsageTypes usage) + { + switch (usage) + { + case TrackUsageTypes.Clean: + return "clean"; + case TrackUsageTypes.Low: + return "low usage"; + case TrackUsageTypes.Slight: + return "slight usage"; + case TrackUsageTypes.ModeratelyLow: + return "moderately low usage"; + case TrackUsageTypes.Moderate: + return "moderate usage"; + case TrackUsageTypes.ModeratelyHigh: + return "moderately high usage"; + case TrackUsageTypes.High: + return "high usage"; + case TrackUsageTypes.Extensive: + return "extensive usage"; + case TrackUsageTypes.Maximum: + return "maximum usage"; + } + return "(unknown setting)"; + } + + public enum TrackUsageTypes + { + Unknown = -1, + Clean, + Slight, + Low, + ModeratelyLow, + Moderate, + ModeratelyHigh, + High, + Extensive, + Maximum + } + + } +} diff --git a/iRacingSdkWrapper/iRacingSimulator/iRacingSimulator.csproj b/iRacingSdkWrapper/iRacingSimulator/iRacingSimulator.csproj new file mode 100644 index 0000000..a64d6c3 --- /dev/null +++ b/iRacingSdkWrapper/iRacingSimulator/iRacingSimulator.csproj @@ -0,0 +1,77 @@ + + + + + Debug + AnyCPU + {1765E7DB-BEE4-4324-A396-923D80B61EA0} + Library + Properties + iRacingSimulator + iRacingSimulator + v4.5.1 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {d6db568b-35b3-49eb-8cb3-e4e5f1424247} + iRacingSdkWrapper + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/irsdkSharp/CVarBuf.cs b/iRacingSdkWrapper/irsdkSharp/CVarBuf.cs new file mode 100644 index 0000000..59fcdac --- /dev/null +++ b/iRacingSdkWrapper/irsdkSharp/CVarBuf.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO.MemoryMappedFiles; +using System.Runtime.InteropServices; + +namespace iRSDKSharp +{ + public class CVarBuf + { + public const int VarHeaderOffset = 56; + public int VarHeaderSize = 144; + //VarBuf offsets + public int VarBufOffset = 48; + public const int VarTickCountOffset = 0; + public const int VarBufOffsetOffset = 4; + public int VarBufSize = 32; + + MemoryMappedViewAccessor FileMapView = null; + CiRSDKHeader Header = null; + + public CVarBuf(MemoryMappedViewAccessor mapView, CiRSDKHeader header) + { + FileMapView = mapView; + Header = header; + VarHeaderSize = Marshal.SizeOf(typeof(VarHeader)); + VarBufSize = Marshal.SizeOf(typeof(VarBuf)); + } + + public int OffsetLatest + { + get + { + int bufCount = Header.BufferCount; + int[] ticks = new int[Header.BufferCount]; + for (int i = 0; i < bufCount; i++) + { + ticks[i] = FileMapView.ReadInt32(VarBufOffset + ((i * VarBufSize) + VarTickCountOffset)); + } + int latestTick = ticks[0]; + int latest = 0; + for (int i = 0; i < bufCount; i++) + { + if (latestTick < ticks[i]) + { + latest = i; + } + } + return FileMapView.ReadInt32(VarBufOffset + ((latest * VarBufSize) + VarBufOffsetOffset)); + } + } + } +} diff --git a/iRacingSdkWrapper/irsdkSharp/CVarHeader.cs b/iRacingSdkWrapper/irsdkSharp/CVarHeader.cs new file mode 100644 index 0000000..000f260 --- /dev/null +++ b/iRacingSdkWrapper/irsdkSharp/CVarHeader.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace iRSDKSharp +{ + public class CVarHeader + { + public enum VarType { irChar, irBool, irInt, irBitField, irFloat, irDouble }; + VarType type; + int offset; + int count; + string name; + string desc; + string unit; + + public CVarHeader(int type, int offset, int count, string name, string desc, string unit) + { + this.type = (VarType)type; + this.offset = offset; + this.count = count; + this.name = name; + this.desc = desc; + this.unit = unit; + } + + public VarType Type + { + get { return type; } + //set { type = value; } + } + + public int Offset + { + get { return offset; } + //set { offset = value; } + } + + public int Count + { + get { return count; } + //set { count = value; } + } + + public string Name + { + get { return name; } + //set { name = value; } + } + + public string Desc + { + get { return desc; } + //set { desc = value; } + } + + public string Unit + { + get { return unit; } + //set { unit = value; } + } + + public int Bytes + { + get + { + if (this.type == VarType.irChar || this.type == VarType.irBool) + return 1; + else if (this.type == VarType.irInt || this.type == VarType.irBitField || this.type == VarType.irFloat) + return 4; + else if (this.type == VarType.irDouble) + return 8; + + return 0; + } + } + + public int Length + { + get + { + return Bytes * Count; + } + } + } +} diff --git a/iRacingSdkWrapper/irsdkSharp/CiRSDKHeader.cs b/iRacingSdkWrapper/irsdkSharp/CiRSDKHeader.cs new file mode 100644 index 0000000..a664048 --- /dev/null +++ b/iRacingSdkWrapper/irsdkSharp/CiRSDKHeader.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO.MemoryMappedFiles; + +namespace iRSDKSharp +{ + public class CiRSDKHeader + { + //Header offsets + public const int HVerOffset = 0; + public const int HStatusOffset = 4; + public const int HTickRateOffset = 8; + public const int HSesInfoUpdateOffset = 12; + public const int HSesInfoLenOffset = 16; + public const int HSesInfoOffsetOffset = 20; + public const int HNumVarsOffset = 24; + public const int HVarHeaderOffsetOffset = 28; + public const int HNumBufOffset = 32; + public const int HBufLenOffset = 36; + + MemoryMappedViewAccessor FileMapView = null; + + CVarBuf buffer = null; + + public CiRSDKHeader(MemoryMappedViewAccessor mapView) + { + FileMapView = mapView; + buffer = new CVarBuf(mapView, this); + } + + public int Version + { + get { return FileMapView.ReadInt32(HVerOffset); } + } + + public int Status + { + get { return FileMapView.ReadInt32(HStatusOffset); } + } + + public int TickRate + { + get { return FileMapView.ReadInt32(HTickRateOffset); } + } + + public int SessionInfoUpdate + { + get { return FileMapView.ReadInt32(HSesInfoUpdateOffset); } + } + + public int SessionInfoLength + { + get { return FileMapView.ReadInt32(HSesInfoLenOffset); } + } + + public int SessionInfoOffset + { + get { return FileMapView.ReadInt32(HSesInfoOffsetOffset); } + } + + public int VarCount + { + get { return FileMapView.ReadInt32(HNumVarsOffset); } + } + + public int VarHeaderOffset + { + get { return FileMapView.ReadInt32(HVarHeaderOffsetOffset); } + } + + public int BufferCount + { + get { return FileMapView.ReadInt32(HNumBufOffset); } + } + + public int BufferLength + { + get { return FileMapView.ReadInt32(HBufLenOffset); } + } + + public int Buffer + { + get + { + return buffer.OffsetLatest; + } + } + } +} diff --git a/iRacingSdkWrapper/irsdkSharp/Properties/AssemblyInfo.cs b/iRacingSdkWrapper/irsdkSharp/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..41abca9 --- /dev/null +++ b/iRacingSdkWrapper/irsdkSharp/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("irsdkSharp")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("irsdkSharp")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("cbf14610-6c31-4e17-955f-78a66206e1e0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/iRacingSdkWrapper/irsdkSharp/YamlParser.cs b/iRacingSdkWrapper/irsdkSharp/YamlParser.cs new file mode 100644 index 0000000..89815c2 --- /dev/null +++ b/iRacingSdkWrapper/irsdkSharp/YamlParser.cs @@ -0,0 +1,165 @@ +namespace iRSDKSharp +{ + // Unsafe (eg - uses pointers and is much faster) implementation of the YAML parser + // Written by Tomasz Terlecki + public class YamlParser + { + enum StateType { Space, Key, KeySep, Value, NewLine }; + + static unsafe int strncmp(char* s1, char* s2, int keylen) + { + while (*s1 == *s2 && keylen-- > 0) + { + if (*s1 == '\0' || keylen == 0) + return (0); + s1++; + s2++; + } + return (*s1 - *s2); + } + + public static unsafe string Parse(string data, string path) + { + char* val = null; + int len = 0; + + int depth = 0; + StateType state = StateType.Space; + + char* keystr = null; + int keylen = 0; + + char* valuestr = null; + int valuelen = 0; + + bool ok = false; + bool end = false; + + fixed (char* pathptrFixed = path.ToCharArray()) + { + int pathdepth = 0; + + fixed (char* dataptrFixed = data.ToCharArray()) + { + + char* pathPtr = pathptrFixed; + char* dataPtr = dataptrFixed; + + while (*dataPtr > 0) + { + switch (*dataPtr) + { + case ' ': + case '-': + if (state == StateType.NewLine) + state = StateType.Space; + if (state == StateType.Space) + depth++; + else if (state == StateType.Key) + keylen++; + else if (state == StateType.Value) + valuelen++; + break; + case ':': + if (state == StateType.Key) + { + state = StateType.KeySep; + keylen++; + } + else if (state == StateType.KeySep) + { + state = StateType.Value; + valuestr = dataPtr; + } + else if (state == StateType.Value) + valuelen++; + break; + case '\n': + case '\r': + if (state != StateType.NewLine) + { + if (depth < pathdepth) + { + ok = false; + end = true; + break; + } + else if (keylen > 0 && 0 == strncmp(keystr, pathPtr, keylen)) + { + bool found = true; + //do we need to test the value? + if (*(pathPtr + keylen) == '{') + { + //search for closing brace + int pathvaluelen = keylen + 1; + while (*(pathPtr + pathvaluelen) > 0 && *(pathPtr + pathvaluelen) != '}') + pathvaluelen++; + + if (valuelen == pathvaluelen - (keylen + 1) && 0 == strncmp(valuestr, (pathPtr + keylen + 1), valuelen)) + pathPtr += valuelen + 2; + else + found = false; + } + + if (found) + { + pathPtr += keylen; + pathdepth = depth; + + if (*pathPtr == '\0') + { + val = valuestr; + len = valuelen; + ok = true; + end = true; + break; + } + } + } + + depth = 0; + keylen = 0; + valuelen = 0; + } + state = StateType.NewLine; + break; + default: + if (state == StateType.Space || state == StateType.NewLine) + { + state = StateType.Key; + keystr = dataPtr; + keylen = 0; //redundant? + } + else if (state == StateType.KeySep) + { + state = StateType.Value; + valuestr = dataPtr; + valuelen = 0; //redundant? + } + if (state == StateType.Key) + keylen++; + if (state == StateType.Value) + valuelen++; + break; + } + + if (end) + { + break; + } + + // important, increment our pointer + dataPtr++; + } + } + } + + if (!ok) + { + return null; + } + + return new string(val, 0, len); + } + } +} diff --git a/iRacingSdkWrapper/irsdkSharp/iRSDKSharp.csproj b/iRacingSdkWrapper/irsdkSharp/iRSDKSharp.csproj new file mode 100644 index 0000000..76394d2 --- /dev/null +++ b/iRacingSdkWrapper/irsdkSharp/iRSDKSharp.csproj @@ -0,0 +1,62 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {72631B85-EB9A-473E-9B4C-65B355A9000D} + Library + Properties + iRSDKSharp + iRSDKSharp + v4.7.2 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + false + + + pdbonly + false + bin\Release\ + TRACE + prompt + 4 + false + true + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/iRacingSdkWrapper/irsdkSharp/iRacingSDK.cs b/iRacingSdkWrapper/irsdkSharp/iRacingSDK.cs new file mode 100644 index 0000000..de0a894 --- /dev/null +++ b/iRacingSdkWrapper/irsdkSharp/iRacingSDK.cs @@ -0,0 +1,338 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; +using System.Threading; +using System.IO.MemoryMappedFiles; + +namespace iRSDKSharp +{ + public enum BroadcastMessageTypes { CamSwitchPos = 0, CamSwitchNum, CamSetState, ReplaySetPlaySpeed, ReplaySetPlayPosition, ReplaySearch, ReplaySetState, ReloadTextures, ChatCommand, PitCommand, TelemCommand, FFBCommand, ReplaySearchSessionTime, VideoCapture }; + public enum CamSwitchModeTypes { FocusAtIncident = -3, FocusAtLeader = -2, FocusAtExciting = -1, FocusAtDriver = 0 }; + public enum CameraStateTypes { None = 0x0000, IsSessionScreen = 0x0001, IsScenicActive = 0x0002, CamToolActive = 0x0004, UIHidden = 0x0008, UseAutoShotSelection = 0x0010, UseTemporaryEdits = 0x0020, UseKeyAcceleration = 0x0040, UseKey10xAcceleration = 0x0080, UseMouseAimMode = 0x0100 }; + public enum ReplayPositionModeTypes { Begin = 0, Current, End }; + public enum ReplaySearchModeTypes { ToStart = 0, ToEnd, PreviousSession, NextSession, PreviousLap, NextLap, PreviousFrame, NextFrame, PreviousIncident, NextIncident }; + public enum ReplayStateModeTypes { Erasetape = 0 }; + public enum ReloadTexturesModeTypes { All = 0, CarIdx }; + public enum ChatCommandModeTypes { Macro = 0, BeginChat, Reply, Cancel }; + + public enum PitCommandModeTypes + { + Clear = 0, + WS = 1, + Fuel = 2, + LF = 3, + RF = 4, + LR = 5, + RR = 6, + ClearTires = 7, + FastRepair = 8 + }; + + public enum TelemCommandModeTypes { Stop = 0, Start, Restart }; + + public class Defines + { + public const uint DesiredAccess = 2031619; + public const string DataValidEventName = "Local\\IRSDKDataValidEvent"; + public const string MemMapFileName = "Local\\IRSDKMemMapFileName"; + public const string BroadcastMessageName = "IRSDK_BROADCASTMSG"; + public const string PadCarNumName = "IRSDK_PADCARNUM"; + public const int MaxString = 32; + public const int MaxDesc = 64; + public const int MaxVars = 4096; + public const int MaxBufs = 4; + public const int StatusConnected = 1; + public const int SessionStringLength = 0x20000; // 128k + } + + public class iRacingSDK + { + //VarHeader offsets + public const int VarOffsetOffset = 4; + public const int VarCountOffset = 8; + public const int VarNameOffset = 16; + public const int VarDescOffset = 48; + public const int VarUnitOffset = 112; + public int VarHeaderSize = 144; + + + public bool IsInitialized = false; + + MemoryMappedFile iRacingFile; + MemoryMappedViewAccessor FileMapView; + + public CiRSDKHeader Header = null; + public Dictionary VarHeaders = new Dictionary(); + //List VarHeaders = new List(); + + public bool Startup() + { + if (IsInitialized) return true; + + try + { + iRacingFile = MemoryMappedFile.OpenExisting(Defines.MemMapFileName); + FileMapView = iRacingFile.CreateViewAccessor(); + + VarHeaderSize = Marshal.SizeOf(typeof(VarHeader)); + + var hEvent = OpenEvent(Defines.DesiredAccess, false, Defines.DataValidEventName); + var are = new AutoResetEvent(false); + are.Handle = hEvent; + + var wh = new WaitHandle[1]; + wh[0] = are; + + WaitHandle.WaitAny(wh); + + Header = new CiRSDKHeader(FileMapView); + GetVarHeaders(); + + IsInitialized = true; + } + catch (Exception) + { + return false; + } + return true; + } + + private void GetVarHeaders() + { + VarHeaders.Clear(); + for (int i = 0; i < Header.VarCount; i++) + { + int type = FileMapView.ReadInt32(Header.VarHeaderOffset + ((i * VarHeaderSize))); + int offset = FileMapView.ReadInt32(Header.VarHeaderOffset + ((i * VarHeaderSize) + VarOffsetOffset)); + int count = FileMapView.ReadInt32(Header.VarHeaderOffset + ((i * VarHeaderSize) + VarCountOffset)); + byte[] name = new byte[Defines.MaxString]; + byte[] desc = new byte[Defines.MaxDesc]; + byte[] unit = new byte[Defines.MaxString]; + FileMapView.ReadArray(Header.VarHeaderOffset + ((i * VarHeaderSize) + VarNameOffset), name, 0, Defines.MaxString); + FileMapView.ReadArray(Header.VarHeaderOffset + ((i * VarHeaderSize) + VarDescOffset), desc, 0, Defines.MaxDesc); + FileMapView.ReadArray(Header.VarHeaderOffset + ((i * VarHeaderSize) + VarUnitOffset), unit, 0, Defines.MaxString); + string nameStr = System.Text.Encoding.Default.GetString(name).TrimEnd(new char[] { '\0' }); + string descStr = System.Text.Encoding.Default.GetString(desc).TrimEnd(new char[] { '\0' }); + string unitStr = System.Text.Encoding.Default.GetString(unit).TrimEnd(new char[] { '\0' }); + VarHeaders[nameStr] = new CVarHeader(type, offset, count, nameStr, descStr, unitStr); + } + } + + public object GetData(string name) + { + if(IsInitialized && Header != null) + { + if (VarHeaders.ContainsKey(name)) + { + int varOffset = VarHeaders[name].Offset; + int count = VarHeaders[name].Count; + if (VarHeaders[name].Type == CVarHeader.VarType.irChar) + { + byte[] data = new byte[count]; + FileMapView.ReadArray(Header.Buffer + varOffset, data, 0, count); + return System.Text.Encoding.Default.GetString(data).TrimEnd(new char[] { '\0' }); + } + else if (VarHeaders[name].Type == CVarHeader.VarType.irBool) + { + if (count > 1) + { + bool[] data = new bool[count]; + FileMapView.ReadArray(Header.Buffer + varOffset, data, 0, count); + return data; + } + else + { + return FileMapView.ReadBoolean(Header.Buffer + varOffset); + } + } + else if (VarHeaders[name].Type == CVarHeader.VarType.irInt || VarHeaders[name].Type == CVarHeader.VarType.irBitField) + { + if (count > 1) + { + int[] data = new int[count]; + FileMapView.ReadArray(Header.Buffer + varOffset, data, 0, count); + return data; + } + else + { + return FileMapView.ReadInt32(Header.Buffer + varOffset); + } + } + else if (VarHeaders[name].Type == CVarHeader.VarType.irFloat) + { + if (count > 1) + { + float[] data = new float[count]; + FileMapView.ReadArray(Header.Buffer + varOffset, data, 0, count); + return data; + } + else + { + return FileMapView.ReadSingle(Header.Buffer + varOffset); + } + } + else if (VarHeaders[name].Type == CVarHeader.VarType.irDouble) + { + if (count > 1) + { + double[] data = new double[count]; + FileMapView.ReadArray(Header.Buffer + varOffset, data, 0, count); + return data; + } + else + { + return FileMapView.ReadDouble(Header.Buffer + varOffset); + } + } + } + } + return null; + } + + public string GetSessionInfo() + { + if(IsInitialized && Header != null) + { + byte[] data = new byte[Header.SessionInfoLength]; + FileMapView.ReadArray(Header.SessionInfoOffset, data, 0, Header.SessionInfoLength); + return System.Text.Encoding.Default.GetString(data).TrimEnd(new char[] { '\0' }); + } + return null; + } + + public bool IsConnected() + { + if (IsInitialized && Header != null) + { + return (Header.Status & 1) > 0; + } + return false; + } + + public void Shutdown() + { + IsInitialized = false; + Header = null; + //FileMapView.Dispose(); + //iRacingFile.Dispose(); + } + + IntPtr GetBroadcastMessageID() + { + return RegisterWindowMessage(Defines.BroadcastMessageName); + } + + IntPtr GetPadCarNumID() + { + return RegisterWindowMessage(Defines.PadCarNumName); + } + + public int BroadcastMessage(BroadcastMessageTypes msg, int var1, int var2, int var3) + { + return BroadcastMessage(msg, var1, MakeLong((short)var2, (short)var3)); + } + + public int BroadcastMessage(BroadcastMessageTypes msg, int var1, int var2) + { + IntPtr msgId = GetBroadcastMessageID(); + IntPtr hwndBroadcast = IntPtr.Add(IntPtr.Zero, 0xffff); + IntPtr result = IntPtr.Zero; + if (msgId != IntPtr.Zero) + { + result = PostMessage(hwndBroadcast, msgId.ToInt32(), MakeLong((short)msg, (short)var1), var2); + } + return result.ToInt32(); + } + + [DllImport("user32.dll")] + private static extern IntPtr RegisterWindowMessage(string lpProcName); + + //[DllImport("user32.dll")] + //private static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); + + [DllImport("user32.dll")] + private static extern IntPtr PostMessage(IntPtr hWnd, int Msg, int wParam, int lParam); + + [DllImport("Kernel32.dll", CharSet = CharSet.Auto)] + private static extern IntPtr OpenEvent(UInt32 dwDesiredAccess, Boolean bInheritHandle, String lpName); + + public int MakeLong(short lowPart, short highPart) + { + return (int)(((ushort)lowPart) | (uint)(highPart << 16)); + } + + public static short HiWord(int dword) + { + return (short)(dword >> 16); + } + + public static short LoWord(int dword) + { + return (short)dword; + } + } + + //144 bytes + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct VarHeader + { + //16 bytes: offset = 0 + public int type; + //offset = 4 + public int offset; + //offset = 8 + public int count; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] + public int[] pad; + + //32 bytes: offset = 16 + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Defines.MaxString)] + public string name; + //64 bytes: offset = 48 + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Defines.MaxDesc)] + public string desc; + //32 bytes: offset = 112 + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Defines.MaxString)] + public string unit; + } + + //32 bytes + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct VarBuf + { + public int tickCount; + public int bufOffset; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] pad; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + public struct iRSDKHeader + { + //12 bytes: offset = 0 + public int ver; + public int status; + public int tickRate; + + //12 bytes: offset = 12 + public int sessionInfoUpdate; + public int sessionInfoLen; + public int sessionInfoOffset; + + //8 bytes: offset = 24 + public int numVars; + public int varHeaderOffset; + + //16 bytes: offset = 32 + public int numBuf; + public int bufLen; + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] + public int[] pad1; + + //128 bytes: offset = 48 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = Defines.MaxBufs)] + public VarBuf[] varBuf; + } +}