Fix HostWatchdogVersion handling

This commit is contained in:
Jordan Brown
2021-01-20 11:34:26 -05:00
parent 5ebf42fd1e
commit 8e40b826f6
3 changed files with 12 additions and 2 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tgstation.Server.Host.Core;
using Tgstation.Server.Host.Properties;
using Tgstation.Server.Host.System;
namespace Tgstation.Server.Host
@@ -17,7 +18,7 @@ namespace Tgstation.Server.Host
/// <summary>
/// The expected host watchdog <see cref="Version"/>.
/// </summary>
internal static readonly Version HostWatchdogVersion = new Version(1, 1, 0);
internal static Version HostWatchdogVersion => Version.Parse(MasterVersionsAttribute.Instance.RawHostWatchdogVersion);
/// <summary>
/// The <see cref="IServerFactory"/> to use.
@@ -31,20 +31,28 @@ namespace Tgstation.Server.Host.Properties
/// </summary>
public string RawControlPanelVersion { get; }
/// <summary>
/// The <see cref="Version"/> <see cref="string"/> of the control panel version built.
/// </summary>
public string RawHostWatchdogVersion { get; }
/// <summary>
/// Initializes a new instance of the <see cref="MasterVersionsAttribute"/> <see langword="class"/>.
/// </summary>
/// <param name="rawConfigurationVersion">The value of <see cref="RawConfigurationVersion"/>.</param>
/// <param name="rawDMApiVersion">The value of <see cref="RawDMApiVersion"/>.</param>
/// <param name="rawControlPanelVersion">The value of <see cref="RawControlPanelVersion"/>.</param>
/// <param name="rawHostWatchdogVersion">The value of <see cref="RawHostWatchdogVersion"/>.</param>
public MasterVersionsAttribute(
string rawConfigurationVersion,
string rawDMApiVersion,
string rawControlPanelVersion)
string rawControlPanelVersion,
string rawHostWatchdogVersion)
{
RawConfigurationVersion = rawConfigurationVersion ?? throw new ArgumentNullException(nameof(rawConfigurationVersion));
RawDMApiVersion = rawDMApiVersion ?? throw new ArgumentNullException(nameof(rawDMApiVersion));
RawControlPanelVersion = rawControlPanelVersion ?? throw new ArgumentNullException(nameof(rawControlPanelVersion));
RawHostWatchdogVersion = rawHostWatchdogVersion ?? throw new ArgumentNullException(nameof(rawHostWatchdogVersion));
}
}
}
@@ -51,6 +51,7 @@
<_Parameter1>$(TgsConfigVersion)</_Parameter1>
<_Parameter2>$(TgsDmapiVersion)</_Parameter2>
<_Parameter3>$(TgsControlPanelVersion)</_Parameter3>
<_Parameter4>$(TgsHostWatchdogVersion)</_Parameter4>
</AssemblyAttributes>
</ItemGroup>