public async void StartInstallWatcher() { watcherToken = new CancellationTokenSource(); await Task.Run(async() => { var stopWatch = Stopwatch.StartNew(); var id = Game.ToSteamGameID(); while (true) { if (watcherToken.IsCancellationRequested) { return; } var gameState = Steam.GetAppState(id); if (gameState.Installed == true) { if (Game.PlayAction == null) { Game.PlayAction = SteamLibrary.CreatePlayTask(Game.ToSteamGameID()); } stopWatch.Stop(); OnInstalled(this, new GameControllerEventArgs(this, stopWatch.Elapsed.TotalSeconds)); return; } await Task.Delay(Playnite.Timer.SecondsToMilliseconds(5)); } }); }
public SteamMetadataProvider(SteamServicesClient playniteServices, SteamLibrary library, SteamApiClient apiClient) { this.library = library; this.playniteServices = playniteServices; this.apiClient = apiClient; }
public SteamGameController(Game game, SteamLibrary library) : base(game) { gameId = game.ToSteamGameID(); this.library = library; }
public SteamMetadataProvider(SteamLibrary library, SteamApiClient apiClient) { this.library = library; this.apiClient = apiClient; }
public SteamMetadataProvider(SteamLibrary library) { this.library = library; apiClient = new SteamApiClient(); }