Ejemplo n.º 1
0
        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));
                }
            });
        }
Ejemplo n.º 2
0
 public SteamMetadataProvider(SteamServicesClient playniteServices, SteamLibrary library, SteamApiClient apiClient)
 {
     this.library          = library;
     this.playniteServices = playniteServices;
     this.apiClient        = apiClient;
 }
Ejemplo n.º 3
0
 public SteamGameController(Game game, SteamLibrary library) : base(game)
 {
     gameId       = game.ToSteamGameID();
     this.library = library;
 }
Ejemplo n.º 4
0
 public SteamMetadataProvider(SteamLibrary library, SteamApiClient apiClient)
 {
     this.library   = library;
     this.apiClient = apiClient;
 }
Ejemplo n.º 5
0
 public SteamMetadataProvider(SteamLibrary library)
 {
     this.library = library;
     apiClient    = new SteamApiClient();
 }