protected override async Task <Process> LaunchImpl(IGameLauncherFactory factory, ILaunchContentAction <IContent> action) { var launcher = factory.Create <IRealVirtualityLauncher>(this); var launchAction = _shouldLaunchAsDedicatedServer.Value ? LaunchAction.LaunchAsDedicatedServer : action.Action; var ls = new LaunchState(GetLaunchExecutable(launchAction), GetExecutable(launchAction), await GetStartupParameters(launcher, action, launchAction).ConfigureAwait(false), launchAction); if (launchAction.IsAsServer()) { Tools.FileUtil.Ops.CreateDirectoryAndSetACLWithFallbackAndRetry(KeysPath); } var launchables = action.GetLaunchables() .OfType <IModContent>() .Select(c => new RvMod(this, c)); foreach (var mod in launchables) { await mod.PreLaunch(action.Action).ConfigureAwait(false); } return(await InitiateLaunch(launcher, ls).ConfigureAwait(false)); }
public override async Task <int> Launch(IGameLauncherFactory factory) { var launchHandler = factory.Create(this); var p = await launchHandler.Launch(LaunchParameters(launchHandler)).ConfigureAwait(false); return(await RegisterLaunchIf(p, launchHandler).ConfigureAwait(false)); }
public Task <int> Launch(IGameLauncherFactory factory) { if (factory == null) { throw new ArgumentNullException(nameof(factory)); } return(default(Task <int>)); }
// TODO: Enter content into LAUNCHING state, then once completed, back to the content's state. public async Task <int> Launch(IGameLauncherFactory factory, ILaunchContentAction <Content> launchContentAction) { var pid = await LaunchInternal(factory, launchContentAction).ConfigureAwait(false); PrepareEvent(new LaunchActionCompleted(this, pid)); return(pid); }
async Task <int> PlayInternal(IGameLauncherFactory factory, IContentInstallationService contentInstallation, IPlayContentAction <IContent> action) { ConfirmPlay(); await InstallInternal(contentInstallation, action.ToInstall()).ConfigureAwait(false); return(await LaunchInternal(factory, action).ConfigureAwait(false)); }
public override async Task <int> Launch(IGameLauncherFactory factory) { var launchHandler = factory.Create(this); await PreLaunch(launchHandler).ConfigureAwait(false); return(await PerformLaunch(launchHandler).ConfigureAwait(false)); }
protected override Task <Process> LaunchImpl(IGameLauncherFactory factory, ILaunchContentAction <IContent> action) { var launcher = factory.Create(this); return(InitiateLaunch(launcher, new LaunchState(GetLaunchExecutable(action.Action), GetExecutable(action.Action), GetStartupParameters(action).ToArray(), action.Action))); }
public override async Task <int> Launch(IGameLauncherFactory factory) { var launchHandler = factory.Create(this); await PreLaunch(launchHandler).ConfigureAwait(false); if (IsLaunchingSteamApp()) { return(await LaunchSteam(launchHandler).ConfigureAwait(false)); } return(await LaunchBasic(launchHandler).ConfigureAwait(false)); }
public LaunchManager(IContentManager cm, IGameContext gameContext, UserSettings settings, IProcessManager processManager, IGameLauncherFactory gameLaunchFactory, IEventAggregator eventBus, IDialogManager dialogManager) { _contentManager = cm; _gameContext = gameContext; _settings = settings; _processManager = processManager; _gameLaunchFactory = gameLaunchFactory; _eventBus = eventBus; _dialogManager = dialogManager; TryHandleServerAddress(); _listTimer = new TimerWithElapsedCancellation(CheckRunningInterval, CheckRunningTimerElapsed); }
async Task <int> LaunchInternal(IGameLauncherFactory factory, ILaunchContentAction <IContent> action) { ConfirmLaunch(); await BeforeLaunch(action).ConfigureAwait(false); int id; using (var p = await LaunchImpl(factory, action).ConfigureAwait(false)) id = p?.Id ?? -1; LastPlayed = Tools.Generic.GetCurrentUtcDateTime; PrepareEvent(new GameLaunched(this, id)); if (Metadata.AfterLaunchDelay.HasValue) { await Task.Delay(Metadata.AfterLaunchDelay.Value, action.CancelToken).ConfigureAwait(false); } return(id); }
public LaunchGameHandler(IDbContextLocator dbContextLocator, IGameLauncherFactory launcherFactory) : base(dbContextLocator) { _launcherFactory = launcherFactory; }
public Task<int> Launch(IGameLauncherFactory factory) { Contract.Requires<ArgumentNullException>(factory != null); return default(Task<int>); }
protected abstract Task <Process> LaunchImpl(IGameLauncherFactory factory, ILaunchContentAction <IContent> action);
public abstract Task <int> Launch(IGameLauncherFactory factory);
public override Task <IReadOnlyCollection <string> > ShortcutLaunchParameters(IGameLauncherFactory factory, string identifier) { throw new NotImplementedException(); }
public override Task <int> Launch(IGameLauncherFactory factory) => LaunchBasic(factory.Create(this));
public override async Task <IReadOnlyCollection <string> > ShortcutLaunchParameters(IGameLauncherFactory factory, string identifier) => null;
public abstract Task <IReadOnlyCollection <string> > ShortcutLaunchParameters(IGameLauncherFactory factory, string identifier);
public override async Task <IReadOnlyCollection <string> > ShortcutLaunchParameters(IGameLauncherFactory factory, string identifier) { var launchHandler = factory.Create(this); var parametersForShortcut = await BuildStartupParametersForShortcut(launchHandler, identifier).ConfigureAwait(false); return(parametersForShortcut.ToArray()); }
public override Task <int> Launch(IGameLauncherFactory factory) { throw new NotImplementedException(); }
public Task <int> Play(IGameLauncherFactory factory, IContentInstallationService contentInstallation, IPlayContentAction <Content> action) => PlayInternal(factory, contentInstallation, action);
public PlayContentHandler(IDbContextLocator gameContext, IGameLauncherFactory factory, IContentInstallationService contentInstallation) : base(gameContext) { _factory = factory; _contentInstallation = contentInstallation; }
public LaunchContentHandler(IDbContextLocator gameContext, IGameLauncherFactory factory) : base(gameContext) { _factory = factory; }