public void OnLapCompleted(MsgLapCompleted msg, int totalLaps) { // Logging.Debug("New lap: " + msg.CarId + ", time: " + TimeSpan.FromMilliseconds(msg.LapTime).ToMillisecondsString()); if (msg.CarId >= Leaderboard.Count) { return; } var item = Leaderboard[msg.CarId]; var lapTime = TimeSpan.FromMilliseconds(msg.LapTime); if ((item.BestLapTime == TimeSpan.Zero || lapTime < item.BestLapTime) && msg.Cuts == 0) { item.BestLapTime = lapTime; } _positionHelperList.Sort(_lapProgressComparer); item.CurrentRacePosition = _positionHelperList.IndexOf(item) + 1; item.CurrentLapStart = DateTime.Now; item.LastLapTime = lapTime; item.CurrentLapValid = true; item.TotalLaps++; if (item.TotalLaps == totalLaps) { item.FinishedPosition = Leaderboard.Count(x => x.FinishedPosition.HasValue); } }
protected override void OnLapCompleted(MsgLapCompleted msg) { DriverInfo driver; if (!PluginManager.TryGetDriverInfo(msg.CarId, out driver)) { PluginManager.Log("Error; car_id " + msg.CarId + " was not known by the PluginManager :("); } else { driver.IsOnOutlap = false; TrySendDistance(driver, true); MRBackend.LapCompletedAsync(msg.CreationDate, msg.CarId, driver.DriverGuid, msg.Laptime, msg.Cuts, msg.GripLevel, ConvertLB(msg.Leaderboard)); } }
protected override void OnLapCompleted(MsgLapCompleted msg) { Leaderboard = msg.Leaderboard; }
public virtual void OnLapCompleted(MsgLapCompleted msg) { }
protected internal virtual void OnLapCompleted(MsgLapCompleted msg) { }