public override void Play() { ReleaseResources(); if (Game.PlayAction.Type == GameActionType.URL && Game.PlayAction.Path.StartsWith("uplay", StringComparison.OrdinalIgnoreCase)) { OnStarting(this, new GameControllerEventArgs(this, 0)); if (Directory.Exists(Game.InstallDirectory)) { var requiresUplay = Uplay.GetGameRequiresUplay(Game); stopWatch = Stopwatch.StartNew(); procMon = new ProcessMonitor(); procMon.TreeStarted += ProcMon_TreeStarted; procMon.TreeDestroyed += Monitor_TreeDestroyed; GameActionActivator.ActivateAction(Game.PlayAction); StartRunningWatcher(requiresUplay); } else { OnStopped(this, new GameControllerEventArgs(this, 0)); } } else { throw new Exception("Unknown Play action configuration."); } }
public override void Play() { ReleaseResources(); OnStarting(this, new GameControllerEventArgs(this, 0)); if (Directory.Exists(Game.InstallDirectory)) { var requiresUplay = Uplay.GetGameRequiresUplay(Game); stopWatch = Stopwatch.StartNew(); procMon = new ProcessMonitor(); procMon.TreeStarted += ProcMon_TreeStarted; procMon.TreeDestroyed += Monitor_TreeDestroyed; ProcessStarter.StartUrl(Uplay.GetLaunchString(Game.GameId)); StartRunningWatcher(requiresUplay); } else { OnStopped(this, new GameControllerEventArgs(this, 0)); } }