Cleanup ByondExecutableLock

This commit is contained in:
Cyberboss
2018-10-02 11:51:08 -04:00
parent c1e7c55449
commit d7f3556e43
2 changed files with 17 additions and 9 deletions
@@ -6,13 +6,26 @@ namespace Tgstation.Server.Host.Components.Byond
sealed class ByondExecutableLock : IByondExecutableLock
{
/// <inheritdoc />
public Version Version { get; set; }
public Version Version { get; }
/// <inheritdoc />
public string DreamDaemonPath { get; set; }
public string DreamDaemonPath { get; }
/// <inheritdoc />
public string DreamMakerPath { get; set; }
public string DreamMakerPath { get; }
/// <summary>
/// Construct a <see cref="ByondExecutableLock"/>
/// </summary>
/// <param name="version">The value of <see cref="Version"/></param>
/// <param name="dreamDaemonPath">The value of <see cref="DreamDaemonPath"/></param>
/// <param name="dreamMakerPath">The value of <see cref="DreamMakerPath"/></param>
public ByondExecutableLock(Version version, string dreamDaemonPath, string dreamMakerPath)
{
Version = version ?? throw new ArgumentNullException(nameof(version));
dreamDaemonPath = dreamDaemonPath ?? throw new ArgumentNullException(nameof(dreamDaemonPath));
dreamMakerPath = dreamMakerPath ?? throw new ArgumentNullException(nameof(dreamMakerPath));
}
//at one point in design, byond versions were to delete themselves if they werent the active version
//That changed at some point so these functions are intentioanlly left blank
@@ -197,12 +197,7 @@ namespace Tgstation.Server.Host.Components.Byond
var versionKey = VersionKey(versionToUse);
return new ByondExecutableLock
{
DreamDaemonPath = ioManager.ResolvePath(ioManager.ConcatPath(versionKey, BinPath, byondInstaller.DreamDaemonName)),
DreamMakerPath = ioManager.ResolvePath(ioManager.ConcatPath(versionKey, BinPath, byondInstaller.DreamMakerName)),
Version = versionToUse
};
return new ByondExecutableLock(versionToUse, ioManager.ResolvePath(ioManager.ConcatPath(versionKey, BinPath, byondInstaller.DreamDaemonName)), ioManager.ResolvePath(ioManager.ConcatPath(versionKey, BinPath, byondInstaller.DreamMakerName)));
}
/// <inheritdoc />