2using System.Collections.Generic;
3using System.Globalization;
5using System.Threading.Tasks;
7using Microsoft.Extensions.Logging;
8using Microsoft.Extensions.Options;
169#pragma warning disable CA1502
198 public InstanceFactory(
222 IOptions<GeneralConfiguration> generalConfigurationOptions,
223 IOptions<SessionConfiguration> sessionConfigurationOptions)
248 generalConfiguration = generalConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(generalConfigurationOptions));
249 sessionConfiguration = sessionConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(sessionConfigurationOptions));
251#pragma warning restore CA1502
256 ArgumentNullException.ThrowIfNull(metadata);
263#pragma warning disable CA1506
266 ArgumentNullException.ThrowIfNull(bridgeRegistrar);
267 ArgumentNullException.ThrowIfNull(metadata);
277 var configurationIoManager =
new ResolvingIOManager(instanceIoManager,
"Configuration");
280 new Dictionary<string, string>
282 {
"instance_name", metadata.Name! },
283 {
"instance_id", metadata.Id!.Value.ToString(CultureInfo.InvariantCulture) },
286 var configuration =
new StaticFiles.Configuration(
287 configurationIoManager,
336 diagnosticsIOManager,
355 sessionControllerFactory,
357 diagnosticsIOManager,
362 metadata.DreamDaemonSettings!);
365 eventConsumer.SetWatchdog(watchdog);
366 commandFactory.SetWatchdog(watchdog);
373 sessionControllerFactory,
411 await chatManager.DisposeAsync();
417 dmbFactory.Dispose();
423 repoManager.Dispose();
427#pragma warning restore CA1506
readonly IDatabaseContextFactory databaseContextFactory
The IDatabaseContextFactory for the InstanceFactory.
readonly ITopicClientFactory topicClientFactory
The ITopicClientFactory for the InstanceFactory.
readonly ISynchronousIOManager synchronousIOManager
The ISynchronousIOManager for the InstanceFactory.
readonly IPlatformIdentifier platformIdentifier
The IPlatformIdentifier for the InstanceFactory.
readonly SessionConfiguration sessionConfiguration
The SessionConfiguration for the InstanceFactory.
readonly IEngineInstaller engineInstaller
The IEngineInstaller for the InstanceFactory.
readonly IIOManager ioManager
The IIOManager for the InstanceFactory.
readonly IAsyncDelayer asyncDelayer
The IAsyncDelayer for the InstanceFactory.
readonly IMetricFactory metricFactory
The IMetricFactory for the InstanceFactory.
readonly IProcessExecutor processExecutor
The IProcessExecutor for the InstanceFactory.
readonly IJobManager jobManager
The IJobManager for the InstanceFactory.
readonly IChatManagerFactory chatFactory
The IChatManagerFactory for the InstanceFactory.
readonly IRepositoryManagerFactory repositoryManagerFactory
The IRepositoryManagerFactory for the InstanceFactory.
readonly IServerPortProvider serverPortProvider
The IServerPortProvider for the InstanceFactory.
readonly GeneralConfiguration generalConfiguration
The GeneralConfiguration for the InstanceFactory.
Task StartAsync(CancellationToken cancellationToken)
Task StopAsync(CancellationToken cancellationToken)
readonly IWatchdogFactory watchdogFactory
The IWatchdogFactory for the InstanceFactory.
static ResolvingIOManager CreateGameIOManager(IIOManager instanceIOManager)
Create the IIOManager pointing to the "Game" directory of a given instanceIOManager .
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the InstanceFactory.
ResolvingIOManager CreateInstanceIOManager(Models.Instance metadata)
Create the IIOManager for a given set of instance metadata .
readonly IPostWriteHandler postWriteHandler
The IPostWriteHandler for the InstanceFactory.
IIOManager CreateGameIOManager(Models.Instance metadata)
Create an IIOManager that resolves to the "Game" directory of the Models.Instance defined by metadata...
readonly IDotnetDumpService dotnetDumpService
The IDotnetDumpService for the InstanceFactory.
readonly ICryptographySuite cryptographySuite
The ICryptographySuite for the InstanceFactory.
async ValueTask< IInstance > CreateInstance(IBridgeRegistrar bridgeRegistrar, Models.Instance metadata)
Create an IInstance.A ValueTask<TResult> resulting in a new IInstance.
readonly IFileTransferTicketProvider fileTransferService
The IFileTransferTicketProvider for the InstanceFactory.
readonly INetworkPromptReaper networkPromptReaper
The INetworkPromptReaper for the InstanceFactory.
readonly IFilesystemLinkFactory linkFactory
The IFilesystemLinkFactory for the InstanceFactory.
readonly IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory
The IRemoteDeploymentManagerFactory for the InstanceFactory.
readonly ILoggerFactory loggerFactory
The ILoggerFactory for the InstanceFactory.
async ValueTask DisposeAsync()
General configuration options.
Configuration options for the game sessions.
An IIOManager that resolve relative paths from another IIOManager to a subdirectory of that.
For creating IChatManagers.
IChatManager CreateChatManager(ICommandFactory commandFactory, IEnumerable< Models.ChatBot > initialChatBots)
Create a IChatManager.
Factory for creating IRemoteDeploymentManagers.
For downloading and installing game engines for a given system.
Task CleanCache(CancellationToken cancellationToken)
Attempts to cleans the engine's cache folder for the system.
Factory for creating IInstances.
Registers IBridgeHandlers.
Factory for creating IRepositoryManagers.
IRepositoryManager CreateRepositoryManager(IIOManager ioManager, IEventConsumer eventConsumer)
Create a IRepositoryManager.
Factory for ITopicClients.
IWatchdog CreateWatchdog(IChatManager chat, IDmbFactory dmbFactory, ISessionPersistor sessionPersistor, ISessionControllerFactory sessionControllerFactory, IIOManager gameIOManager, IIOManager diagnosticsIOManager, IEventConsumer eventConsumer, IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory, IMetricFactory metricFactory, Api.Models.Instance instance, DreamDaemonSettings settings)
Creates a IWatchdog.
Provides access to the server's HttpApiPort.
Factory for scoping usage of IDatabaseContexts. Meant for use by Components.
For creating filesystem symbolic links.
Interface for using filesystems.
Handles changing file modes/permissions after writing.
For accessing the disk in a synchronous manner.
Manages the runtime of Jobs.
Contains various cryptographic functions.
Service for managing the dotnet-dump installation.
On Windows, DreamDaemon will show an unskippable prompt when using /world/proc/OpenPort()....
Service for temporarily storing files to be downloaded or uploaded.
For waiting asynchronously.