3using System.Threading.Tasks;
5using Microsoft.Extensions.Logging;
6using Microsoft.Extensions.Options;
165#pragma warning disable CA1502
194 public InstanceFactory(
218 IOptions<GeneralConfiguration> generalConfigurationOptions,
219 IOptions<SessionConfiguration> sessionConfigurationOptions)
244 generalConfiguration = generalConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(generalConfigurationOptions));
245 sessionConfiguration = sessionConfigurationOptions?.Value ??
throw new ArgumentNullException(nameof(sessionConfigurationOptions));
247#pragma warning restore CA1502
252 ArgumentNullException.ThrowIfNull(metadata);
259#pragma warning disable CA1506
262 ArgumentNullException.ThrowIfNull(bridgeRegistrar);
263 ArgumentNullException.ThrowIfNull(metadata);
273 var configurationIoManager =
new ResolvingIOManager(instanceIoManager,
"Configuration");
275 var configuration =
new StaticFiles.Configuration(
276 configurationIoManager,
329 diagnosticsIOManager,
346 sessionControllerFactory,
348 diagnosticsIOManager,
352 metadata.DreamDaemonSettings);
355 eventConsumer.SetWatchdog(watchdog);
356 commandFactory.SetWatchdog(watchdog);
363 sessionControllerFactory,
400 await chatManager.DisposeAsync();
406 dmbFactory.Dispose();
412 repoManager.Dispose();
416#pragma warning restore CA1506
426 public Task
StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
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 IIOManager ioManager
The IIOManager for the InstanceFactory.
readonly IAsyncDelayer asyncDelayer
The IAsyncDelayer for the InstanceFactory.
readonly IGitRemoteFeaturesFactory gitRemoteFeaturesFactory
The IGitRemoteFeaturesFactory for the InstanceFactory.
readonly IProcessExecutor processExecutor
The IProcessExecutor for the InstanceFactory.
readonly IJobManager jobManager
The IJobManager for the InstanceFactory.
readonly ILibGit2RepositoryFactory repositoryFactory
The ILibGit2RepositoryFactory for the InstanceFactory.
readonly IChatManagerFactory chatFactory
The IChatManagerFactory for the InstanceFactory.
IIOManager CreateInstanceIOManager(Models.Instance metadata)
Create the IIOManager for a given set of instance metadata .
readonly IServerPortProvider serverPortProvider
The IServerPortProvider for the InstanceFactory.
readonly IByondInstaller byondInstaller
The IByondInstaller for the InstanceFactory.
readonly ILibGit2Commands repositoryCommands
The ILibGit2Commands 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.
readonly IAssemblyInformationProvider assemblyInformationProvider
The IAssemblyInformationProvider for the InstanceFactory.
readonly IPostWriteHandler postWriteHandler
The IPostWriteHandler for the InstanceFactory.
void CheckSystemCompatibility()
Test that the repositoryFactory is functional.
IIOManager CreateGameIOManager(Models.Instance metadata)
Create an IIOManager that resolves to the "Game" directory of the Models.Instance defined by metadata...
async Task< IInstance > CreateInstance(IBridgeRegistrar bridgeRegistrar, Models.Instance metadata)
Create an IInstance. A Task<TResult> resulting in a new IInstance.
readonly ICryptographySuite cryptographySuite
The ICryptographySuite for the InstanceFactory.
readonly ISymlinkFactory symlinkFactory
The ISymlinkFactory for the InstanceFactory.
readonly IFileTransferTicketProvider fileTransferService
The IFileTransferTicketProvider for the InstanceFactory.
readonly INetworkPromptReaper networkPromptReaper
The INetworkPromptReaper for the InstanceFactory.
readonly IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory
The IRemoteDeploymentManagerFactory for the InstanceFactory.
readonly ILoggerFactory loggerFactory
The ILoggerFactory for the InstanceFactory.
static IIOManager CreateGameIOManager(IIOManager instanceIOManager)
Create the IIOManager pointing to the "Game" directory of a given instanceIOManager .
async ValueTask DisposeAsync()
Repository(LibGit2Sharp.IRepository libGitRepo, ILibGit2Commands commands, IIOManager ioMananger, IEventConsumer eventConsumer, ICredentialsProvider credentialsProvider, IPostWriteHandler postWriteHandler, IGitRemoteFeaturesFactory gitRemoteFeaturesFactory, ILogger< Repository > logger, GeneralConfiguration generalConfiguration, Action onDispose)
Initializes a new instance of the Repository class.
General configuration options.
Configuration options for the game sessions.
An IIOManager that resolve relative paths from another IIOManager to a subdirectory of that.
For downloading and installing BYOND extractions for a given system.
Task CleanCache(CancellationToken cancellationToken)
Attempts to cleans the BYOND cache folder for the system.
For creating IChatManagers.
IChatManager CreateChatManager(ICommandFactory commandFactory, IEnumerable< Models.ChatBot > initialChatBots)
Create a IChatManager.
Factory for creating IRemoteDeploymentManagers.
Factory for creating IInstances.
Registers IBridgeHandlers.
Factory for creating IGitRemoteFeatures.
For low level interactions with a LibGit2Sharp.IRepository.
Factory for creating LibGit2Sharp.IRepositorys.
void CreateInMemory()
Create and destory an in-memeory LibGit2Sharp.IRepository.
Factory for ITopicClients.
IWatchdog CreateWatchdog(IChatManager chat, IDmbFactory dmbFactory, ISessionPersistor sessionPersistor, ISessionControllerFactory sessionControllerFactory, IIOManager gameIOManager, IIOManager diagnosticsIOManager, IEventConsumer eventConsumer, IRemoteDeploymentManagerFactory remoteDeploymentManagerFactory, 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.
Interface for using filesystems.
Handles changing file modes/permissions after writing.
For creating filesystem symbolic links.
For accessing the disk in a synchronous manner.
Manages the runtime of Jobs.
Contains various cryptographic functions.
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.