mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-07-18 03:23:07 +01:00
Rename ByondManager to EngineManager
This commit is contained in:
+8
-8
@@ -20,7 +20,7 @@ using Tgstation.Server.Host.Utils;
|
||||
namespace Tgstation.Server.Host.Components.Byond
|
||||
{
|
||||
/// <inheritdoc />
|
||||
sealed class ByondManager : IByondManager
|
||||
sealed class EngineManager : IEngineManager
|
||||
{
|
||||
/// <summary>
|
||||
/// The path to the BYOND bin folder.
|
||||
@@ -66,24 +66,24 @@ namespace Tgstation.Server.Host.Components.Byond
|
||||
static readonly SemaphoreSlim UserFilesSemaphore = new (1);
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IIOManager"/> for the <see cref="ByondManager"/>.
|
||||
/// The <see cref="IIOManager"/> for the <see cref="EngineManager"/>.
|
||||
/// </summary>
|
||||
readonly IIOManager ioManager;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IByondInstaller"/> for the <see cref="ByondManager"/>.
|
||||
/// The <see cref="IByondInstaller"/> for the <see cref="EngineManager"/>.
|
||||
/// </summary>
|
||||
readonly IByondInstaller byondInstaller;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IEventConsumer"/> for the <see cref="ByondManager"/>.
|
||||
/// The <see cref="IEventConsumer"/> for the <see cref="EngineManager"/>.
|
||||
/// </summary>
|
||||
readonly IEventConsumer eventConsumer;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ILogger"/> for the <see cref="ByondManager"/>.
|
||||
/// The <see cref="ILogger"/> for the <see cref="EngineManager"/>.
|
||||
/// </summary>
|
||||
readonly ILogger<ByondManager> logger;
|
||||
readonly ILogger<EngineManager> logger;
|
||||
|
||||
/// <summary>
|
||||
/// Map of byond <see cref="Version"/>s to <see cref="Task"/>s that complete when they are installed.
|
||||
@@ -116,13 +116,13 @@ namespace Tgstation.Server.Host.Components.Byond
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ByondManager"/> class.
|
||||
/// Initializes a new instance of the <see cref="EngineManager"/> class.
|
||||
/// </summary>
|
||||
/// <param name="ioManager">The value of <see cref="ioManager"/>.</param>
|
||||
/// <param name="byondInstaller">The value of <see cref="byondInstaller"/>.</param>
|
||||
/// <param name="eventConsumer">The value of <see cref="eventConsumer"/>.</param>
|
||||
/// <param name="logger">The value of <see cref="logger"/>.</param>
|
||||
public ByondManager(IIOManager ioManager, IByondInstaller byondInstaller, IEventConsumer eventConsumer, ILogger<ByondManager> logger)
|
||||
public EngineManager(IIOManager ioManager, IByondInstaller byondInstaller, IEventConsumer eventConsumer, ILogger<EngineManager> logger)
|
||||
{
|
||||
this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
|
||||
this.byondInstaller = byondInstaller ?? throw new ArgumentNullException(nameof(byondInstaller));
|
||||
+2
-2
@@ -11,10 +11,10 @@ using Tgstation.Server.Host.Jobs;
|
||||
namespace Tgstation.Server.Host.Components.Byond
|
||||
{
|
||||
/// <summary>
|
||||
/// For managing the BYOND installation.
|
||||
/// For managing the engine installations.
|
||||
/// </summary>
|
||||
/// <remarks>When passing in <see cref="ByondVersion.Version"/>s for <see cref="EngineType.Byond"/>, ensure they are BYOND format versions unless referring to a custom version. This means <see cref="Version.Build"/> should NEVER be 0.</remarks>
|
||||
public interface IByondManager : IComponentService, IDisposable
|
||||
public interface IEngineManager : IComponentService, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The currently active <see cref="ByondVersion"/>.
|
||||
@@ -99,7 +99,7 @@ namespace Tgstation.Server.Host.Components.Byond
|
||||
postWriteHandler.HandleWrite(IOManager.ResolvePath(pathToScript));
|
||||
}
|
||||
|
||||
var basePath = IOManager.ConcatPath(path, ByondManager.BinPath);
|
||||
var basePath = IOManager.ConcatPath(path, EngineManager.BinPath);
|
||||
|
||||
var ddTask = WriteAndMakeExecutable(
|
||||
IOManager.ConcatPath(basePath, GetDreamDaemonName(version, out _, out _)),
|
||||
|
||||
@@ -235,7 +235,7 @@ namespace Tgstation.Server.Host.Components.Byond
|
||||
var dreamDaemonPath = IOManager.ResolvePath(
|
||||
IOManager.ConcatPath(
|
||||
path,
|
||||
ByondManager.BinPath,
|
||||
EngineManager.BinPath,
|
||||
dreamDaemonName));
|
||||
|
||||
Logger.LogInformation("Adding Windows Firewall exception for {path}...", dreamDaemonPath);
|
||||
|
||||
@@ -25,9 +25,9 @@ namespace Tgstation.Server.Host.Components.Chat.Commands
|
||||
public bool AdminOnly => false;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IByondManager"/> for the <see cref="ByondCommand"/>.
|
||||
/// The <see cref="IEngineManager"/> for the <see cref="ByondCommand"/>.
|
||||
/// </summary>
|
||||
readonly IByondManager byondManager;
|
||||
readonly IEngineManager engineManager;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IWatchdog"/> for the <see cref="ByondCommand"/>.
|
||||
@@ -37,11 +37,11 @@ namespace Tgstation.Server.Host.Components.Chat.Commands
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ByondCommand"/> class.
|
||||
/// </summary>
|
||||
/// <param name="byondManager">The value of <see cref="byondManager"/>.</param>
|
||||
/// <param name="engineManager">The value of <see cref="engineManager"/>.</param>
|
||||
/// <param name="watchdog">The value of <see cref="watchdog"/>.</param>
|
||||
public ByondCommand(IByondManager byondManager, IWatchdog watchdog)
|
||||
public ByondCommand(IEngineManager engineManager, IWatchdog watchdog)
|
||||
{
|
||||
this.byondManager = byondManager ?? throw new ArgumentNullException(nameof(byondManager));
|
||||
this.engineManager = engineManager ?? throw new ArgumentNullException(nameof(engineManager));
|
||||
this.watchdog = watchdog ?? throw new ArgumentNullException(nameof(watchdog));
|
||||
}
|
||||
|
||||
@@ -51,22 +51,22 @@ namespace Tgstation.Server.Host.Components.Chat.Commands
|
||||
if (arguments.Split(' ').Any(x => x.Equals("--active", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
string text;
|
||||
if (byondManager.ActiveVersion == null)
|
||||
if (engineManager.ActiveVersion == null)
|
||||
text = "None!";
|
||||
else
|
||||
switch (byondManager.ActiveVersion.Engine.Value)
|
||||
switch (engineManager.ActiveVersion.Engine.Value)
|
||||
{
|
||||
case EngineType.OpenDream:
|
||||
text = $"OpenDream: {byondManager.ActiveVersion.SourceCommittish}";
|
||||
text = $"OpenDream: {engineManager.ActiveVersion.SourceCommittish}";
|
||||
break;
|
||||
case EngineType.Byond:
|
||||
text = $"BYOND {byondManager.ActiveVersion.Version.Major}.{byondManager.ActiveVersion.Version.Minor}";
|
||||
if (byondManager.ActiveVersion.Version.Build != -1)
|
||||
text = $"BYOND {engineManager.ActiveVersion.Version.Major}.{engineManager.ActiveVersion.Version.Minor}";
|
||||
if (engineManager.ActiveVersion.Version.Build != -1)
|
||||
text += " (Custom Build)";
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException($"Invalid EngineType: {byondManager.ActiveVersion.Engine.Value}");
|
||||
throw new InvalidOperationException($"Invalid EngineType: {engineManager.ActiveVersion.Engine.Value}");
|
||||
}
|
||||
|
||||
return ValueTask.FromResult(
|
||||
|
||||
@@ -19,9 +19,9 @@ namespace Tgstation.Server.Host.Components.Chat.Commands
|
||||
readonly IAssemblyInformationProvider assemblyInformationProvider;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IByondManager"/> for the <see cref="CommandFactory"/>.
|
||||
/// The <see cref="IEngineManager"/> for the <see cref="CommandFactory"/>.
|
||||
/// </summary>
|
||||
readonly IByondManager byondManager;
|
||||
readonly IEngineManager engineManager;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IRepositoryManager"/> for the <see cref="CommandFactory"/>.
|
||||
@@ -52,21 +52,21 @@ namespace Tgstation.Server.Host.Components.Chat.Commands
|
||||
/// Initializes a new instance of the <see cref="CommandFactory"/> class.
|
||||
/// </summary>
|
||||
/// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/>.</param>
|
||||
/// <param name="byondManager">The value of <see cref="byondManager"/>.</param>
|
||||
/// <param name="engineManager">The value of <see cref="engineManager"/>.</param>
|
||||
/// <param name="repositoryManager">The value of <see cref="repositoryManager"/>.</param>
|
||||
/// <param name="databaseContextFactory">The value of <see cref="databaseContextFactory"/>.</param>
|
||||
/// <param name="compileJobProvider">The value of <see cref="compileJobProvider"/>.</param>
|
||||
/// <param name="instance">The value of <see cref="instance"/>.</param>
|
||||
public CommandFactory(
|
||||
IAssemblyInformationProvider assemblyInformationProvider,
|
||||
IByondManager byondManager,
|
||||
IEngineManager engineManager,
|
||||
IRepositoryManager repositoryManager,
|
||||
IDatabaseContextFactory databaseContextFactory,
|
||||
ILatestCompileJobProvider compileJobProvider,
|
||||
Models.Instance instance)
|
||||
{
|
||||
this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
|
||||
this.byondManager = byondManager ?? throw new ArgumentNullException(nameof(byondManager));
|
||||
this.engineManager = engineManager ?? throw new ArgumentNullException(nameof(engineManager));
|
||||
this.repositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager));
|
||||
this.databaseContextFactory = databaseContextFactory ?? throw new ArgumentNullException(nameof(databaseContextFactory));
|
||||
this.compileJobProvider = compileJobProvider ?? throw new ArgumentNullException(nameof(compileJobProvider));
|
||||
@@ -92,7 +92,7 @@ namespace Tgstation.Server.Host.Components.Chat.Commands
|
||||
return new List<ICommand>
|
||||
{
|
||||
new VersionCommand(assemblyInformationProvider),
|
||||
new ByondCommand(byondManager, watchdog),
|
||||
new ByondCommand(engineManager, watchdog),
|
||||
new RevisionCommand(watchdog, repositoryManager),
|
||||
new PullRequestsCommand(watchdog, repositoryManager, databaseContextFactory, compileJobProvider, instance),
|
||||
new KekCommand(),
|
||||
|
||||
@@ -41,9 +41,9 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
const string DmeExtension = "dme";
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IByondManager"/> for <see cref="DreamMaker"/>.
|
||||
/// The <see cref="IEngineManager"/> for <see cref="DreamMaker"/>.
|
||||
/// </summary>
|
||||
readonly IByondManager byond;
|
||||
readonly IEngineManager engineManager;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IIOManager"/> for <see cref="DreamMaker"/>.
|
||||
@@ -143,7 +143,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DreamMaker"/> class.
|
||||
/// </summary>
|
||||
/// <param name="byond">The value of <see cref="byond"/>.</param>
|
||||
/// <param name="engineManager">The value of <see cref="engineManager"/>.</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>
|
||||
@@ -158,7 +158,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
/// <param name="sessionConfiguration">The value of <see cref="sessionConfiguration"/>.</param>
|
||||
/// <param name="metadata">The value of <see cref="metadata"/>.</param>
|
||||
public DreamMaker(
|
||||
IByondManager byond,
|
||||
IEngineManager engineManager,
|
||||
IIOManager ioManager,
|
||||
StaticFiles.IConfiguration configuration,
|
||||
ISessionControllerFactory sessionControllerFactory,
|
||||
@@ -173,7 +173,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
SessionConfiguration sessionConfiguration,
|
||||
Api.Models.Instance metadata)
|
||||
{
|
||||
this.byond = byond ?? throw new ArgumentNullException(nameof(byond));
|
||||
this.engineManager = engineManager ?? throw new ArgumentNullException(nameof(engineManager));
|
||||
this.ioManager = ioManager ?? throw new ArgumentNullException(nameof(ioManager));
|
||||
this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
|
||||
this.sessionControllerFactory = sessionControllerFactory ?? throw new ArgumentNullException(nameof(sessionControllerFactory));
|
||||
@@ -482,7 +482,7 @@ namespace Tgstation.Server.Host.Components.Deployment
|
||||
var progressTask = ProgressTask(progressReporter, estimatedDuration, progressCts.Token);
|
||||
try
|
||||
{
|
||||
using var byondLock = await byond.UseExecutables(null, null, cancellationToken);
|
||||
using var byondLock = await engineManager.UseExecutables(null, null, cancellationToken);
|
||||
currentChatCallback = chatManager.QueueDeploymentMessage(
|
||||
revisionInformation,
|
||||
byondLock.Version,
|
||||
|
||||
@@ -20,9 +20,9 @@ namespace Tgstation.Server.Host.Components
|
||||
IRepositoryManager RepositoryManager { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IByondManager"/> for the <see cref="IInstanceCore"/>.
|
||||
/// The <see cref="IEngineManager"/> for the <see cref="IInstanceCore"/>.
|
||||
/// </summary>
|
||||
IByondManager ByondManager { get; }
|
||||
IEngineManager EngineManager { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IDreamMaker"/> for the <see cref="IInstanceCore"/>.
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Tgstation.Server.Host.Components
|
||||
public IRepositoryManager RepositoryManager { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IByondManager ByondManager { get; }
|
||||
public IEngineManager EngineManager { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IWatchdog Watchdog { get; }
|
||||
@@ -105,7 +105,7 @@ namespace Tgstation.Server.Host.Components
|
||||
/// </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="engineManager">The value of <see cref="EngineManager"/>.</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>
|
||||
@@ -119,7 +119,7 @@ namespace Tgstation.Server.Host.Components
|
||||
public Instance(
|
||||
Api.Models.Instance metadata,
|
||||
IRepositoryManager repositoryManager,
|
||||
IByondManager byondManager,
|
||||
IEngineManager engineManager,
|
||||
IDreamMaker dreamMaker,
|
||||
IWatchdog watchdog,
|
||||
IChatManager chat,
|
||||
@@ -134,7 +134,7 @@ namespace Tgstation.Server.Host.Components
|
||||
{
|
||||
this.metadata = metadata ?? throw new ArgumentNullException(nameof(metadata));
|
||||
RepositoryManager = repositoryManager ?? throw new ArgumentNullException(nameof(repositoryManager));
|
||||
ByondManager = byondManager ?? throw new ArgumentNullException(nameof(byondManager));
|
||||
EngineManager = engineManager ?? throw new ArgumentNullException(nameof(engineManager));
|
||||
DreamMaker = dreamMaker ?? throw new ArgumentNullException(nameof(dreamMaker));
|
||||
Watchdog = watchdog ?? throw new ArgumentNullException(nameof(watchdog));
|
||||
Chat = chat ?? throw new ArgumentNullException(nameof(chat));
|
||||
@@ -160,7 +160,7 @@ namespace Tgstation.Server.Host.Components
|
||||
Configuration.Dispose();
|
||||
dmbFactory.Dispose();
|
||||
RepositoryManager.Dispose();
|
||||
ByondManager.Dispose();
|
||||
EngineManager.Dispose();
|
||||
await chatDispose;
|
||||
await watchdogDispose;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ namespace Tgstation.Server.Host.Components
|
||||
await Task.WhenAll(
|
||||
SetAutoUpdateInterval(metadata.AutoUpdateInterval.Value).AsTask(),
|
||||
Configuration.StartAsync(cancellationToken),
|
||||
ByondManager.StartAsync(cancellationToken),
|
||||
EngineManager.StartAsync(cancellationToken),
|
||||
Chat.StartAsync(cancellationToken),
|
||||
dmbFactory.StartAsync(cancellationToken));
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace Tgstation.Server.Host.Components
|
||||
await Watchdog.StopAsync(cancellationToken);
|
||||
await Task.WhenAll(
|
||||
Configuration.StopAsync(cancellationToken),
|
||||
ByondManager.StopAsync(cancellationToken),
|
||||
EngineManager.StopAsync(cancellationToken),
|
||||
Chat.StopAsync(cancellationToken),
|
||||
dmbFactory.StopAsync(cancellationToken));
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Tgstation.Server.Host.Components
|
||||
generalConfiguration);
|
||||
try
|
||||
{
|
||||
var byond = new ByondManager(byondIOManager, byondInstaller, eventConsumer, loggerFactory.CreateLogger<ByondManager>());
|
||||
var byond = new EngineManager(byondIOManager, byondInstaller, eventConsumer, loggerFactory.CreateLogger<EngineManager>());
|
||||
|
||||
var dmbFactory = new DmbFactory(
|
||||
databaseContextFactory,
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace Tgstation.Server.Host.Components
|
||||
public IRepositoryManager RepositoryManager => Instance.RepositoryManager;
|
||||
|
||||
/// <inheritdoc />
|
||||
public IByondManager ByondManager => Instance.ByondManager;
|
||||
public IEngineManager EngineManager => Instance.EngineManager;
|
||||
|
||||
/// <inheritdoc />
|
||||
public IDreamMaker DreamMaker => Instance.DreamMaker;
|
||||
|
||||
@@ -42,9 +42,9 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
readonly IProcessExecutor processExecutor;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IByondManager"/> for the <see cref="SessionControllerFactory"/>.
|
||||
/// The <see cref="IEngineManager"/> for the <see cref="SessionControllerFactory"/>.
|
||||
/// </summary>
|
||||
readonly IByondManager byond;
|
||||
readonly IEngineManager engineManager;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="ITopicClientFactory"/> for the <see cref="SessionControllerFactory"/>.
|
||||
@@ -147,7 +147,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
/// Initializes a new instance of the <see cref="SessionControllerFactory"/> class.
|
||||
/// </summary>
|
||||
/// <param name="processExecutor">The value of <see cref="processExecutor"/>.</param>
|
||||
/// <param name="byond">The value of <see cref="byond"/>.</param>
|
||||
/// <param name="engineManager">The value of <see cref="engineManager"/>.</param>
|
||||
/// <param name="topicClientFactory">The value of <see cref="topicClientFactory"/>.</param>
|
||||
/// <param name="cryptographySuite">The value of <see cref="cryptographySuite"/>.</param>
|
||||
/// <param name="assemblyInformationProvider">The value of <see cref="assemblyInformationProvider"/>.</param>
|
||||
@@ -166,7 +166,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
/// <param name="sessionConfiguration">The value of <see cref="sessionConfiguration"/>.</param>
|
||||
public SessionControllerFactory(
|
||||
IProcessExecutor processExecutor,
|
||||
IByondManager byond,
|
||||
IEngineManager engineManager,
|
||||
ITopicClientFactory topicClientFactory,
|
||||
ICryptographySuite cryptographySuite,
|
||||
IAssemblyInformationProvider assemblyInformationProvider,
|
||||
@@ -185,7 +185,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
Api.Models.Instance instance)
|
||||
{
|
||||
this.processExecutor = processExecutor ?? throw new ArgumentNullException(nameof(processExecutor));
|
||||
this.byond = byond ?? throw new ArgumentNullException(nameof(byond));
|
||||
this.engineManager = engineManager ?? throw new ArgumentNullException(nameof(engineManager));
|
||||
this.topicClientFactory = topicClientFactory ?? throw new ArgumentNullException(nameof(topicClientFactory));
|
||||
this.cryptographySuite = cryptographySuite ?? throw new ArgumentNullException(nameof(cryptographySuite));
|
||||
this.assemblyInformationProvider = assemblyInformationProvider ?? throw new ArgumentNullException(nameof(assemblyInformationProvider));
|
||||
@@ -239,7 +239,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
}
|
||||
|
||||
// get the byond lock
|
||||
var byondLock = currentByondLock ?? await byond.UseExecutables(
|
||||
var byondLock = currentByondLock ?? await engineManager.UseExecutables(
|
||||
dmbProvider.ByondVersion,
|
||||
gameIOManager.ConcatPath(dmbProvider.Directory, dmbProvider.DmbName),
|
||||
cancellationToken);
|
||||
@@ -370,7 +370,7 @@ namespace Tgstation.Server.Host.Components.Session
|
||||
|
||||
logger.LogTrace("Begin session reattach...");
|
||||
var byondTopicSender = topicClientFactory.CreateTopicClient(reattachInformation.TopicRequestTimeout);
|
||||
var byondLock = await byond.UseExecutables(
|
||||
var byondLock = await engineManager.UseExecutables(
|
||||
reattachInformation.Dmb.ByondVersion,
|
||||
null, // Doesn't matter if it's trusted or not on reattach
|
||||
cancellationToken);
|
||||
|
||||
@@ -84,10 +84,10 @@ namespace Tgstation.Server.Host.Controllers
|
||||
public ValueTask<IActionResult> Read()
|
||||
=> WithComponentInstance(instance =>
|
||||
ValueTask.FromResult<IActionResult>(
|
||||
instance.ByondManager.ActiveVersion != null
|
||||
instance.EngineManager.ActiveVersion != null
|
||||
? Json(
|
||||
new ByondResponse(
|
||||
instance.ByondManager.ActiveVersion))
|
||||
instance.EngineManager.ActiveVersion))
|
||||
: Conflict(new ErrorMessageResponse(ErrorCode.ResourceNotPresent))));
|
||||
|
||||
/// <summary>
|
||||
@@ -107,7 +107,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
() => ValueTask.FromResult(
|
||||
new PaginatableResult<ByondResponse>(
|
||||
instance
|
||||
.ByondManager
|
||||
.EngineManager
|
||||
.InstalledVersions
|
||||
.Select(x => new ByondResponse(x))
|
||||
.AsQueryable()
|
||||
@@ -169,7 +169,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
return await WithComponentInstance(
|
||||
async instance =>
|
||||
{
|
||||
var byondManager = instance.ByondManager;
|
||||
var byondManager = instance.EngineManager;
|
||||
var versionAlreadyInstalled = !uploadingZip && byondManager.InstalledVersions.Any(x => x.Equals(model));
|
||||
if (versionAlreadyInstalled)
|
||||
{
|
||||
@@ -231,7 +231,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
async (core, databaseContextFactory, paramJob, progressHandler, jobCancellationToken) =>
|
||||
{
|
||||
if (sourceRepo != null)
|
||||
await core.ByondManager.EnsureEngineSource(
|
||||
await core.EngineManager.EnsureEngineSource(
|
||||
sourceRepo,
|
||||
model.Engine.Value,
|
||||
jobCancellationToken);
|
||||
@@ -254,7 +254,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
}
|
||||
|
||||
await using (zipFileStream)
|
||||
await core.ByondManager.ChangeVersion(
|
||||
await core.EngineManager.ChangeVersion(
|
||||
progressHandler,
|
||||
model,
|
||||
zipFileStream,
|
||||
@@ -306,7 +306,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
var notInstalledResponse = await WithComponentInstance(
|
||||
instance =>
|
||||
{
|
||||
var byondManager = instance.ByondManager;
|
||||
var byondManager = instance.EngineManager;
|
||||
|
||||
if (model.Equals(byondManager.ActiveVersion))
|
||||
return ValueTask.FromResult<IActionResult>(
|
||||
@@ -343,7 +343,7 @@ namespace Tgstation.Server.Host.Controllers
|
||||
await jobManager.RegisterOperation(
|
||||
job,
|
||||
(instanceCore, databaseContextFactory, job, progressReporter, jobCancellationToken)
|
||||
=> instanceCore.ByondManager.DeleteVersion(progressReporter, model, jobCancellationToken),
|
||||
=> instanceCore.EngineManager.DeleteVersion(progressReporter, model, jobCancellationToken),
|
||||
cancellationToken);
|
||||
|
||||
var apiResponse = job.ToApi();
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Tgstation.Server.Tests.Live
|
||||
|
||||
var commandFactory = new CommandFactory(
|
||||
Mock.Of<IAssemblyInformationProvider>(),
|
||||
Mock.Of<IByondManager>(),
|
||||
Mock.Of<IEngineManager>(),
|
||||
Mock.Of<IRepositoryManager>(),
|
||||
Mock.Of<IDatabaseContextFactory>(),
|
||||
Mock.Of<ILatestCompileJobProvider>(),
|
||||
|
||||
@@ -441,7 +441,7 @@ namespace Tgstation.Server.Tests
|
||||
|
||||
var ddPath = ioManager.ConcatPath(
|
||||
tempPath,
|
||||
ByondManager.BinPath,
|
||||
EngineManager.BinPath,
|
||||
byondInstaller.GetDreamDaemonName(byondVersion, out var supportsCli, out var shouldSupportMapThreads));
|
||||
|
||||
Assert.IsTrue(supportsCli);
|
||||
|
||||
Reference in New Issue
Block a user