private static async Task PrepareReplay(Game.StartProperties properties, IGameUi ui, CancellationToken cancellation) { var replayProperties = properties.ReplayProperties; if (replayProperties != null) { var replayFilename = replayProperties.Filename ?? Path.Combine(AcPaths.GetReplaysDirectory(), replayProperties.Name); ui.OnProgress("Checking replay for fake cars…"); var fakes = await FakeCarsHelper.GetFakeCarsIds(replayFilename); if (fakes.Count > 0) { Logging.Debug("Fakes found: " + fakes.Select(x => $"{x.FakeId} ({x.SourceId})").JoinToString(", ")); foreach (var fake in fakes) { var car = CarsManager.Instance.GetById(fake.SourceId); if (car != null) { FakeCarsHelper.CreateFakeCar(car, fake.FakeId, null); } else { Logging.Warning("Original not found: " + fake.SourceId); } } } } }
public void Report(Game.ProgressState value) { _ui.OnProgress(value); }