public async void StartInstallWatcher() { watcherToken = new CancellationTokenSource(); while (true) { if (watcherToken.IsCancellationRequested) { return; } var installedGame = UplayLibrary.GetInstalledGames().FirstOrDefault(a => a.GameId == Game.GameId); if (installedGame != null) { var installInfo = new GameInfo() { PlayAction = installedGame.PlayAction, InstallDirectory = installedGame.InstallDirectory }; OnInstalled(this, new GameInstalledEventArgs(installInfo, this, 0)); return; } await Task.Delay(2000); } }
public UplayLibrarySettings(UplayLibrary library) { this.library = library; var settings = library.LoadPluginSettings <UplayLibrarySettings>(); if (settings != null) { LoadValues(settings); } }
public UplayLibrarySettings(UplayLibrary library, IPlayniteAPI api) { this.library = library; this.api = api; var settings = api.LoadPluginSettings <UplayLibrarySettings>(library); if (settings != null) { LoadValues(settings); } }
public async void StartUninstallWatcher() { watcherToken = new CancellationTokenSource(); while (true) { if (watcherToken.IsCancellationRequested) { return; } if (UplayLibrary.GetInstalledGames().FirstOrDefault(a => a.GameId == Game.GameId) == null) { OnUninstalled(this, new GameControllerEventArgs(this, 0)); return; } await Task.Delay(2000); } }
public UplayGameController(UplayLibrary library, Game game) : base(game) { uplay = library; }