/// <summary> /// Initializes a new instance of the <see cref="BasicWatchdog"/> <see langword="class"/>. /// </summary> /// <param name="chat">The <see cref="IChatManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="reattachInfoHandler">The <see cref="IReattachInfoHandler"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="databaseContextFactory">The <see cref="IDatabaseContextFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="instance">The <see cref="Api.Models.Instance"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="autoStart">The autostart value for the <see cref="WatchdogBase"/>.</param> public BasicWatchdog( IChatManager chat, ISessionControllerFactory sessionControllerFactory, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, IDatabaseContextFactory databaseContextFactory, IJobManager jobManager, IServerControl serverControl, IAsyncDelayer asyncDelayer, ILogger <BasicWatchdog> logger, DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) : base( chat, sessionControllerFactory, dmbFactory, reattachInfoHandler, databaseContextFactory, jobManager, serverControl, asyncDelayer, logger, initialLaunchParameters, instance, autoStart) { }
/// <summary> /// Construct an <see cref="Instance"/> /// </summary> /// <param name="metadata">The value of <see cref="metadata"/></param> /// <param name="repositoryManager">The value of <see cref="RepositoryManager"/></param> /// <param name="byondManager">The value of <see cref="ByondManager"/></param> /// <param name="dreamMaker">The value of <see cref="dreamMaker"/></param> /// <param name="watchdog">The value of <see cref="Watchdog"/></param> /// <param name="chat">The value of <see cref="Chat"/></param> /// <param name="configuration">The value of <see cref="Configuration"/></param> /// <param name="compileJobConsumer">The value of <see cref="compileJobConsumer"/></param> /// <param name="databaseContextFactory">The value of <see cref="databaseContextFactory"/></param> /// <param name="dmbFactory">The value of <see cref="dmbFactory"/></param> /// <param name="jobManager">The value of <see cref="jobManager"/></param> /// <param name="eventConsumer">The value of <see cref="eventConsumer"/></param> /// <param name="gitHubClientFactory">The value of <see cref="gitHubClientFactory"/></param> /// <param name="logger">The value of <see cref="logger"/></param> public Instance( Api.Models.Instance metadata, IRepositoryManager repositoryManager, IByondManager byondManager, IDreamMaker dreamMaker, IWatchdog watchdog, IChat chat, StaticFiles.IConfiguration configuration, ICompileJobConsumer compileJobConsumer, IDatabaseContextFactory databaseContextFactory, IDmbFactory dmbFactory, IJobManager jobManager, IEventConsumer eventConsumer, IGitHubClientFactory gitHubClientFactory, ILogger <Instance> logger) { this.metadata = metadata ?? throw new ArgumentNullException(nameof(metadata)); RepositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager)); ByondManager = byondManager ?? throw new ArgumentNullException(nameof(byondManager)); this.dreamMaker = dreamMaker ?? throw new ArgumentNullException(nameof(dreamMaker)); Watchdog = watchdog ?? throw new ArgumentNullException(nameof(watchdog)); Chat = chat ?? throw new ArgumentNullException(nameof(chat)); Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); this.compileJobConsumer = compileJobConsumer ?? throw new ArgumentNullException(nameof(compileJobConsumer)); this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory)); this.dmbFactory = dmbFactory ?? throw new ArgumentNullException(nameof(dmbFactory)); this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager)); this.eventConsumer = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer)); this.gitHubClientFactory = gitHubClientFactory ?? throw new ArgumentNullException(nameof(gitHubClientFactory)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
/// <summary> /// Initializes a new instance of the <see cref="BasicWatchdog"/> <see langword="class"/>. /// </summary> /// <param name="chat">The <see cref="IChatManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="sessionPersistor">The <see cref="ISessionPersistor"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="diagnosticsIOManager">The <see cref="IIOManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="eventConsumer">The <see cref="IEventConsumer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="remoteDeploymentManagerFactory">The <see cref="IRemoteDeploymentManagerFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="instance">The <see cref="Api.Models.Instance"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="autoStart">The autostart value for the <see cref="WatchdogBase"/>.</param> public BasicWatchdog( IChatManager chat, ISessionControllerFactory sessionControllerFactory, IDmbFactory dmbFactory, ISessionPersistor sessionPersistor, IJobManager jobManager, IServerControl serverControl, IAsyncDelayer asyncDelayer, IIOManager diagnosticsIOManager, IEventConsumer eventConsumer, IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory, ILogger <BasicWatchdog> logger, DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) : base( chat, sessionControllerFactory, dmbFactory, sessionPersistor, jobManager, serverControl, asyncDelayer, diagnosticsIOManager, eventConsumer, remoteDeploymentManagerFactory, logger, initialLaunchParameters, instance, autoStart) { }
/// <summary> /// Construct a <see cref="ReattachInfoHandler"/> /// </summary> /// <param name="databaseContextFactory">The value of <see cref="databaseContextFactory"/></param> /// <param name="dmbFactory">The value of <see cref="dmbFactory"/></param> /// <param name="logger">The value of <see cref="logger"/></param> /// <param name="metadata">The value of <see cref="metadata"/></param> public ReattachInfoHandler(IDatabaseContextFactory databaseContextFactory, IDmbFactory dmbFactory, ILogger <ReattachInfoHandler> logger, Api.Models.Instance metadata) { this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory)); this.dmbFactory = dmbFactory ?? throw new ArgumentNullException(nameof(dmbFactory)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.metadata = metadata ?? throw new ArgumentNullException(nameof(metadata)); }
/// <summary> /// Construct a <see cref="IWatchdog"/> /// </summary> /// <param name="chat">The value of <see cref="chat"/></param> /// <param name="sessionControllerFactory">The value of <see cref="sessionControllerFactory"/></param> /// <param name="dmbFactory">The value of <see cref="dmbFactory"/></param> /// <param name="serverUpdater">The <see cref="IServerControl"/> for the <see cref="Watchdog"/></param> /// <param name="logger">The value of <see cref="logger"/></param> /// <param name="reattachInfoHandler">The value of <see cref="reattachInfoHandler"/></param> /// <param name="databaseContextFactory">The value of <see cref="databaseContextFactory"/></param> /// <param name="byondTopicSender">The value of <see cref="byondTopicSender"/></param> /// <param name="initialLaunchParameters">The initial value of <see cref="ActiveLaunchParameters"/></param> /// <param name="instance">The value of <see cref="instance"/></param> /// <param name="autoStart">The value of <see cref="autoStart"/></param> /// <param name="eventConsumer">The value of <see cref="eventConsumer"/></param> public Watchdog(IChat chat, ISessionControllerFactory sessionControllerFactory, IDmbFactory dmbFactory, IServerControl serverUpdater, ILogger <Watchdog> logger, IReattachInfoHandler reattachInfoHandler, IDatabaseContextFactory databaseContextFactory, IByondTopicSender byondTopicSender, IEventConsumer eventConsumer, DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) { this.chat = chat ?? throw new ArgumentNullException(nameof(chat)); this.sessionControllerFactory = sessionControllerFactory ?? throw new ArgumentNullException(nameof(sessionControllerFactory)); this.dmbFactory = dmbFactory ?? throw new ArgumentNullException(nameof(dmbFactory)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.reattachInfoHandler = reattachInfoHandler ?? throw new ArgumentNullException(nameof(reattachInfoHandler)); this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory)); this.byondTopicSender = byondTopicSender ?? throw new ArgumentNullException(nameof(byondTopicSender)); this.eventConsumer = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer)); this.instance = instance ?? throw new ArgumentNullException(nameof(instance)); this.autoStart = autoStart; if (serverUpdater == null) { throw new ArgumentNullException(nameof(serverUpdater)); } serverUpdater.RegisterForRestart(() => releaseServers = true); chat.RegisterCommandHandler(this); AlphaIsActive = true; ActiveLaunchParameters = initialLaunchParameters; releaseServers = false; semaphore = new SemaphoreSlim(1); activeParametersUpdated = new TaskCompletionSource <object>(); }
/// <summary> /// Construct an <see cref="Instance"/> /// </summary> /// <param name="metadata">The value of <see cref="metadata"/></param> /// <param name="repositoryManager">The value of <see cref="RepositoryManager"/></param> /// <param name="byondManager">The value of <see cref="ByondManager"/></param> /// <param name="dreamMaker">The value of <see cref="DreamMaker"/></param> /// <param name="watchdog">The value of <see cref="Watchdog"/></param> /// <param name="chat">The value of <see cref="Chat"/></param> /// <param name="configuration">The value of <see cref="Configuration"/></param> /// <param name="dmbFactory">The value of <see cref="dmbFactory"/></param> /// <param name="jobManager">The value of <see cref="jobManager"/></param> /// <param name="eventConsumer">The value of <see cref="eventConsumer"/></param> /// <param name="remoteDeploymentManagerFactory">The value of <see cref="remoteDeploymentManagerFactory"/>.</param> /// <param name="logger">The value of <see cref="logger"/></param> public Instance( Api.Models.Instance metadata, IRepositoryManager repositoryManager, IByondManager byondManager, IDreamMaker dreamMaker, IWatchdog watchdog, IChatManager chat, StaticFiles.IConfiguration configuration, IDmbFactory dmbFactory, IJobManager jobManager, IEventConsumer eventConsumer, IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory, ILogger <Instance> logger) { this.metadata = metadata ?? throw new ArgumentNullException(nameof(metadata)); RepositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager)); ByondManager = byondManager ?? throw new ArgumentNullException(nameof(byondManager)); DreamMaker = dreamMaker ?? throw new ArgumentNullException(nameof(dreamMaker)); Watchdog = watchdog ?? throw new ArgumentNullException(nameof(watchdog)); Chat = chat ?? throw new ArgumentNullException(nameof(chat)); Configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); this.dmbFactory = dmbFactory ?? throw new ArgumentNullException(nameof(dmbFactory)); this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager)); this.eventConsumer = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer)); this.remoteDeploymentManagerFactory = remoteDeploymentManagerFactory ?? throw new ArgumentNullException(nameof(remoteDeploymentManagerFactory)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); timerLock = new object(); }
/// <inheritdoc /> protected override IWatchdog CreateNonExperimentalWatchdog( IChat chat, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, IEventConsumer eventConsumer, ISessionControllerFactory sessionControllerFactory, IIOManager ioManager, Api.Models.Instance instance, DreamDaemonSettings settings) => new WindowsWatchdog( chat, sessionControllerFactory, dmbFactory, reattachInfoHandler, DatabaseContextFactory, ByondTopicSender, eventConsumer, JobManager, ServerControl, AsyncDelayer, ioManager, symlinkFactory, LoggerFactory.CreateLogger <WindowsWatchdog>(), settings, instance, settings.AutoStart.Value);
/// <inheritdoc /> public IWatchdog CreateWatchdog( IChat chat, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, IEventConsumer eventConsumer, ISessionControllerFactory sessionControllerFactory, IIOManager ioManager, Api.Models.Instance instance, DreamDaemonSettings settings) { if (GeneralConfiguration.UseExperimentalWatchdog) { return(new ExperimentalWatchdog( chat, sessionControllerFactory, dmbFactory, reattachInfoHandler, DatabaseContextFactory, ByondTopicSender, eventConsumer, JobManager, ServerControl, AsyncDelayer, LoggerFactory.CreateLogger <ExperimentalWatchdog>(), settings, instance, settings.AutoStart.Value)); } return(CreateNonExperimentalWatchdog(chat, dmbFactory, reattachInfoHandler, eventConsumer, sessionControllerFactory, ioManager, instance, settings)); }
/// <inheritdoc /> public virtual IWatchdog CreateWatchdog( IChatManager chat, IDmbFactory dmbFactory, ISessionPersistor sessionPersistor, ISessionControllerFactory sessionControllerFactory, IIOManager gameIOManager, IIOManager diagnosticsIOManager, IEventConsumer eventConsumer, Api.Models.Instance instance, DreamDaemonSettings settings) => new BasicWatchdog(
/// <inheritdoc /> public override IWatchdog CreateWatchdog( IChatManager chat, IDmbFactory dmbFactory, ISessionPersistor sessionPersistor, ISessionControllerFactory sessionControllerFactory, IIOManager gameIOManager, IIOManager diagnosticsIOManager, IEventConsumer eventConsumer, IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory, Api.Models.Instance instance, DreamDaemonSettings settings) => new WindowsWatchdog(
/// <summary> /// Initializes a new instance of the <see cref="WatchdogBase"/> <see langword="class"/>. /// </summary> /// <param name="chat">The value of <see cref="Chat"/></param> /// <param name="sessionControllerFactory">The value of <see cref="SessionControllerFactory"/></param> /// <param name="dmbFactory">The value of <see cref="DmbFactory"/></param> /// <param name="reattachInfoHandler">The value of <see cref="reattachInfoHandler"/></param> /// <param name="databaseContextFactory">The value of <see cref="databaseContextFactory"/></param> /// <param name="byondTopicSender">The value of <see cref="byondTopicSender"/></param> /// <param name="eventConsumer">The value of <see cref="eventConsumer"/></param> /// <param name="jobManager">The value of <see cref="jobManager"/></param> /// <param name="serverControl">The <see cref="IServerControl"/> to populate <see cref="restartRegistration"/> with</param> /// <param name="asyncDelayer">The value of <see cref="AsyncDelayer"/>.</param> /// <param name="logger">The value of <see cref="Logger"/></param> /// <param name="initialLaunchParameters">The initial value of <see cref="ActiveLaunchParameters"/>. May be modified</param> /// <param name="instance">The value of <see cref="instance"/></param> /// <param name="autoStart">The value of <see cref="autoStart"/></param> protected WatchdogBase( IChat chat, ISessionControllerFactory sessionControllerFactory, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, IDatabaseContextFactory databaseContextFactory, IByondTopicSender byondTopicSender, IEventConsumer eventConsumer, IJobManager jobManager, IServerControl serverControl, IAsyncDelayer asyncDelayer, ILogger logger, DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) { Chat = chat ?? throw new ArgumentNullException(nameof(chat)); SessionControllerFactory = sessionControllerFactory ?? throw new ArgumentNullException(nameof(sessionControllerFactory)); DmbFactory = dmbFactory ?? throw new ArgumentNullException(nameof(dmbFactory)); AsyncDelayer = asyncDelayer ?? throw new ArgumentNullException(nameof(asyncDelayer)); this.reattachInfoHandler = reattachInfoHandler ?? throw new ArgumentNullException(nameof(reattachInfoHandler)); this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory)); this.byondTopicSender = byondTopicSender ?? throw new ArgumentNullException(nameof(byondTopicSender)); this.eventConsumer = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer)); this.jobManager = jobManager ?? throw new ArgumentNullException(nameof(jobManager)); Logger = logger ?? throw new ArgumentNullException(nameof(logger)); ActiveLaunchParameters = initialLaunchParameters ?? throw new ArgumentNullException(nameof(initialLaunchParameters)); this.instance = instance ?? throw new ArgumentNullException(nameof(instance)); this.autoStart = autoStart; if (serverControl == null) { throw new ArgumentNullException(nameof(serverControl)); } chat.RegisterCommandHandler(this); ActiveLaunchParameters = initialLaunchParameters; releaseServers = false; ActiveParametersUpdated = new TaskCompletionSource <object>(); restartRegistration = serverControl.RegisterForRestart(this); try { Semaphore = new SemaphoreSlim(1); } catch { restartRegistration.Dispose(); throw; } }
/// <summary> /// Construct a <see cref="SessionPersistor"/> /// </summary> /// <param name="databaseContextFactory">The value of <see cref="databaseContextFactory"/></param> /// <param name="dmbFactory">The value of <see cref="dmbFactory"/></param> /// <param name="processExecutor">The value of <see cref="processExecutor"/></param> /// <param name="logger">The value of <see cref="logger"/></param> /// <param name="metadata">The value of <see cref="metadata"/></param> public SessionPersistor( IDatabaseContextFactory databaseContextFactory, IDmbFactory dmbFactory, IProcessExecutor processExecutor, ILogger <SessionPersistor> logger, Api.Models.Instance metadata) { this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory)); this.dmbFactory = dmbFactory ?? throw new ArgumentNullException(nameof(dmbFactory)); this.processExecutor = processExecutor ?? throw new ArgumentNullException(nameof(processExecutor)); this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.metadata = metadata ?? throw new ArgumentNullException(nameof(metadata)); }
/// <summary> /// Initializes a new instance of the <see cref="WindowsWatchdog"/> class. /// </summary> /// <param name="chat">The <see cref="IChatManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="sessionPersistor">The <see cref="ISessionPersistor"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="diagnosticsIOManager">The <see cref="IIOManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="eventConsumer">The <see cref="IEventConsumer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="remoteDeploymentManagerFactory">The <see cref="IRemoteDeploymentManagerFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="gameIOManager">The value of <see cref="GameIOManager"/>.</param> /// <param name="symlinkFactory">The value of <see cref="symlinkFactory"/>.</param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="instance">The <see cref="Api.Models.Instance"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="autoStart">The autostart value for the <see cref="WatchdogBase"/>.</param> public WindowsWatchdog( IChatManager chat, ISessionControllerFactory sessionControllerFactory, IDmbFactory dmbFactory, ISessionPersistor sessionPersistor, IJobManager jobManager, IServerControl serverControl, IAsyncDelayer asyncDelayer, IIOManager diagnosticsIOManager, IEventConsumer eventConsumer, IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory, IIOManager gameIOManager, ISymlinkFactory symlinkFactory, ILogger <WindowsWatchdog> logger, DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) : base( chat, sessionControllerFactory, dmbFactory, sessionPersistor, jobManager, serverControl, asyncDelayer, diagnosticsIOManager, eventConsumer, remoteDeploymentManagerFactory, logger, initialLaunchParameters, instance, autoStart) { try { GameIOManager = gameIOManager ?? throw new ArgumentNullException(nameof(gameIOManager)); this.symlinkFactory = symlinkFactory ?? throw new ArgumentNullException(nameof(symlinkFactory)); } catch { _ = DisposeAsync(); throw; } }
/// <summary> /// Initializes a new instance of the <see cref="WindowsWatchdog"/> <see langword="class"/>. /// </summary> /// <param name="chat">The <see cref="IChat"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="reattachInfoHandler">The <see cref="IReattachInfoHandler"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="databaseContextFactory">The <see cref="IDatabaseContextFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="byondTopicSender">The <see cref="IByondTopicSender"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="eventConsumer">The <see cref="IEventConsumer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="ioManager">The value of <see cref="ioManager"/>.</param> /// <param name="symlinkFactory">The value of <see cref="symlinkFactory"/>.</param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="instance">The <see cref="Api.Models.Instance"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="autoStart">The autostart value for the <see cref="WatchdogBase"/>.</param> public WindowsWatchdog( IChat chat, ISessionControllerFactory sessionControllerFactory, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, IDatabaseContextFactory databaseContextFactory, IByondTopicSender byondTopicSender, IEventConsumer eventConsumer, IJobManager jobManager, IServerControl serverControl, IAsyncDelayer asyncDelayer, IIOManager ioManager, ISymlinkFactory symlinkFactory, ILogger <WindowsWatchdog> logger, DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) : base( chat, sessionControllerFactory, dmbFactory, reattachInfoHandler, databaseContextFactory, byondTopicSender, eventConsumer, jobManager, serverControl, asyncDelayer, logger, initialLaunchParameters, instance, autoStart) { try { this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager)); this.symlinkFactory = symlinkFactory ?? throw new ArgumentNullException(nameof(symlinkFactory)); } catch { Dispose(); throw; } }
/// <summary> /// Create a <see cref="IWatchdog"/> that isn't the <see cref="ExperimentalWatchdog"/>. /// </summary> /// <param name="chat">The <see cref="IChatManager"/> for the <see cref="IWatchdog"/></param> /// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="IWatchdog"/> with</param> /// <param name="reattachInfoHandler">The <see cref="IReattachInfoHandler"/> for the <see cref="IWatchdog"/></param> /// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="IWatchdog"/></param> /// <param name="ioManager">The <see cref="IIOManager"/> for the <see cref="IWatchdog"/>.</param> /// <param name="instance">The <see cref="Instance"/> for the <see cref="IWatchdog"/></param> /// <param name="settings">The initial <see cref="DreamDaemonSettings"/> for the <see cref="IWatchdog"/></param> /// <returns>A new <see cref="IWatchdog"/></returns> protected virtual IWatchdog CreateNonExperimentalWatchdog( IChatManager chat, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, ISessionControllerFactory sessionControllerFactory, IIOManager ioManager, Api.Models.Instance instance, DreamDaemonSettings settings) => new BasicWatchdog( chat, sessionControllerFactory, dmbFactory, reattachInfoHandler, DatabaseContextFactory, JobManager, ServerControl, AsyncDelayer, LoggerFactory.CreateLogger <BasicWatchdog>(), settings, instance, settings.AutoStart.Value);
/// <inheritdoc /> public IWatchdog CreateWatchdog(IDmbFactory dmbFactory, DreamDaemonSettings settings) => new Watchdog(chat, sessionControllerFactory, dmbFactory, serverUpdater, loggerFactory.CreateLogger <Watchdog>(), reattachInfoHandler, databaseContextFactory, byondTopicSender, eventConsumer, settings, instance, settings.AutoStart.Value);
/// <inheritdoc /> public IWatchdog CreateWatchdog(IChat chat, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, IEventConsumer eventConsumer, ISessionControllerFactory sessionControllerFactory, Api.Models.Instance instance, DreamDaemonSettings settings) => new Watchdog(chat, sessionControllerFactory, dmbFactory, loggerFactory.CreateLogger <Watchdog>(), reattachInfoHandler, databaseContextFactory, byondTopicSender, eventConsumer, jobManager, serverControl, settings, instance, settings.AutoStart.Value);
/// <summary> /// Initializes a new instance of the <see cref="ExperimentalWatchdog"/> <see langword="class"/>. /// </summary> /// <param name="chat">The <see cref="IChat"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="sessionControllerFactory">The <see cref="ISessionControllerFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="dmbFactory">The <see cref="IDmbFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="reattachInfoHandler">The <see cref="IReattachInfoHandler"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="databaseContextFactory">The <see cref="IDatabaseContextFactory"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="byondTopicSender">The <see cref="IByondTopicSender"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="eventConsumer">The <see cref="IEventConsumer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="jobManager">The <see cref="IJobManager"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="serverControl">The <see cref="IServerControl"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="asyncDelayer">The <see cref="IAsyncDelayer"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="logger">The <see cref="ILogger"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="initialLaunchParameters">The <see cref="DreamDaemonLaunchParameters"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="instance">The <see cref="Api.Models.Instance"/> for the <see cref="WatchdogBase"/>.</param> /// <param name="autoStart">The autostart value for the <see cref="WatchdogBase"/>.</param> public ExperimentalWatchdog(IChat chat, ISessionControllerFactory sessionControllerFactory, IDmbFactory dmbFactory, IReattachInfoHandler reattachInfoHandler, IDatabaseContextFactory databaseContextFactory, IByondTopicSender byondTopicSender, IEventConsumer eventConsumer, IJobManager jobManager, IServerControl serverControl, IAsyncDelayer asyncDelayer, ILogger <ExperimentalWatchdog> logger, DreamDaemonLaunchParameters initialLaunchParameters, Api.Models.Instance instance, bool autoStart) : base( chat, sessionControllerFactory, dmbFactory, reattachInfoHandler, databaseContextFactory, byondTopicSender, eventConsumer, jobManager, serverControl, asyncDelayer, logger, initialLaunchParameters, instance, autoStart) { alphaIsActive = true; }