Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DreamMaker"/> class.
        /// </summary>
        /// <param name="byond">The value of <see cref="byond"/>.</param>
        /// <param name="ioManager">The value of <see cref="ioManager"/>.</param>
        /// <param name="configuration">The value of <see cref="configuration"/>.</param>
        /// <param name="sessionControllerFactory">The value of <see cref="sessionControllerFactory"/>.</param>
        /// <param name="eventConsumer">The value of <see cref="eventConsumer"/>.</param>
        /// <param name="chatManager">The value of <see cref="chatManager"/>.</param>
        /// <param name="processExecutor">The value of <see cref="processExecutor"/>.</param>
        /// <param name="compileJobConsumer">The value of <see cref="compileJobConsumer"/>.</param>
        /// <param name="repositoryManager">The value of <see cref="repositoryManager"/>.</param>
        /// <param name="remoteDeploymentManagerFactory">The value of <see cref="remoteDeploymentManagerFactory"/>.</param>
        /// <param name="logger">The value of <see cref="logger"/>.</param>
        /// <param name="metadata">The value of <see cref="metadata"/>.</param>
        public DreamMaker(
            IByondManager byond,
            IIOManager ioManager,
            StaticFiles.IConfiguration configuration,
            ISessionControllerFactory sessionControllerFactory,
            IEventConsumer eventConsumer,
            IChatManager chatManager,
            IProcessExecutor processExecutor,
            ICompileJobSink compileJobConsumer,
            IRepositoryManager repositoryManager,
            IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory,
            ILogger <DreamMaker> logger,
            Api.Models.Instance metadata)
        {
            this.byond                          = byond ?? throw new ArgumentNullException(nameof(byond));
            this.ioManager                      = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
            this.configuration                  = configuration ?? throw new ArgumentNullException(nameof(configuration));
            this.sessionControllerFactory       = sessionControllerFactory ?? throw new ArgumentNullException(nameof(sessionControllerFactory));
            this.eventConsumer                  = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer));
            this.chatManager                    = chatManager ?? throw new ArgumentNullException(nameof(chatManager));
            this.processExecutor                = processExecutor ?? throw new ArgumentNullException(nameof(processExecutor));
            this.compileJobConsumer             = compileJobConsumer ?? throw new ArgumentNullException(nameof(compileJobConsumer));
            this.repositoryManager              = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager));
            this.remoteDeploymentManagerFactory = remoteDeploymentManagerFactory ?? throw new ArgumentNullException(nameof(remoteDeploymentManagerFactory));
            this.logger                         = logger ?? throw new ArgumentNullException(nameof(logger));
            this.metadata                       = metadata ?? throw new ArgumentNullException(nameof(metadata));

            deploymentLock = new object();
        }
 /// <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)
 {
 }
Esempio n. 3
0
 /// <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)
 {
 }
Esempio n. 4
0
        /// <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>();
        }
        /// <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 />
 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);
Esempio n. 7
0
 /// <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(
Esempio n. 8
0
 /// <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(
Esempio n. 9
0
 /// <summary>
 /// Construct a <see cref="WatchdogFactory"/>
 /// </summary>
 /// <param name="chat">The value of <see cref="chat"/></param>
 /// <param name="sessionControllerFactory">The value of <see cref="sessionControllerFactory"/></param>
 /// <param name="serverUpdater">The value of <see cref="serverUpdater"/></param>
 /// <param name="loggerFactory">The value of <see cref="loggerFactory"/></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="instance">The value of <see cref="instance"/></param>
 public WatchdogFactory(IChat chat, ISessionControllerFactory sessionControllerFactory, IServerControl serverUpdater, ILoggerFactory loggerFactory, IReattachInfoHandler reattachInfoHandler, IDatabaseContextFactory databaseContextFactory, IByondTopicSender byondTopicSender, IEventConsumer eventConsumer, Api.Models.Instance instance)
 {
     this.chat = chat ?? throw new ArgumentNullException(nameof(chat));
     this.sessionControllerFactory = sessionControllerFactory ?? throw new ArgumentNullException(nameof(sessionControllerFactory));
     this.serverUpdater            = serverUpdater ?? throw new ArgumentNullException(nameof(serverUpdater));
     this.loggerFactory            = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
     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));
 }
Esempio n. 10
0
        /// <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;
            }
        }
Esempio n. 11
0
 /// <summary>
 /// Construct <see cref="DreamMaker"/>
 /// </summary>
 /// <param name="byond">The value of <see cref="byond"/></param>
 /// <param name="ioManager">The value of <see cref="ioManager"/></param>
 /// <param name="configuration">The value of <see cref="configuration"/></param>
 /// <param name="sessionControllerFactory">The value of <see cref="sessionControllerFactory"/></param>
 /// <param name="compileJobConsumer">The value of <see cref="compileJobConsumer"/></param>
 /// <param name="application">The value of <see cref="application"/></param>
 /// <param name="eventConsumer">The value of <see cref="eventConsumer"/></param>
 /// <param name="chat">The value of <see cref="chat"/></param>
 /// <param name="processExecutor">The value of <see cref="processExecutor"/></param>
 /// <param name="logger">The value of <see cref="logger"/></param>
 public DreamMaker(IByondManager byond, IIOManager ioManager, StaticFiles.IConfiguration configuration, ISessionControllerFactory sessionControllerFactory, ICompileJobConsumer compileJobConsumer, IApplication application, IEventConsumer eventConsumer, IChat chat, IProcessExecutor processExecutor, ILogger <DreamMaker> logger)
 {
     this.byond                    = byond;
     this.ioManager                = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
     this.configuration            = configuration ?? throw new ArgumentNullException(nameof(configuration));
     this.sessionControllerFactory = sessionControllerFactory ?? throw new ArgumentNullException(nameof(sessionControllerFactory));
     this.compileJobConsumer       = compileJobConsumer ?? throw new ArgumentNullException(nameof(compileJobConsumer));
     this.application              = application ?? throw new ArgumentNullException(nameof(application));
     this.eventConsumer            = eventConsumer ?? throw new ArgumentNullException(nameof(eventConsumer));
     this.chat            = chat ?? throw new ArgumentNullException(nameof(chat));
     this.processExecutor = processExecutor ?? throw new ArgumentNullException(nameof(processExecutor));
     this.logger          = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 /// <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="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;
 }
Esempio n. 14
0
 /// <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;
     }
 }
Esempio n. 15
0
 /// <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(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);