private void ac_PhysicsUpdated(object sender, AssettoCorsaSharedMemory.PhysicsEventArgs e) { if (port == null || !port.IsOpen) return; try { port.WriteLine("^R," + e.Physics.Rpms + "$"); port.WriteLine("^S," + e.Physics.SpeedKmh + "$"); } catch { } }
private void ac_StaticInfoUpdated(object sender, AssettoCorsaSharedMemory.StaticInfoEventArgs e) { if (port == null || !port.IsOpen) return; try { if (e.StaticInfo.MaxRpm != maxRpm) { port.WriteLine("^I,RPM," + e.StaticInfo.MaxRpm + "$"); maxRpm = e.StaticInfo.MaxRpm; } } catch { } }