mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-29 08:00:19 +01:00
Nullify SwarmRegistrationRequest
This commit is contained in:
@@ -3,8 +3,6 @@ using System.ComponentModel.DataAnnotations;
|
||||
|
||||
using Tgstation.Server.Api.Models.Internal;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Tgstation.Server.Host.Swarm
|
||||
{
|
||||
/// <summary>
|
||||
@@ -16,6 +14,15 @@ namespace Tgstation.Server.Host.Swarm
|
||||
/// The TGS <see cref="Version"/> of the sending server.
|
||||
/// </summary>
|
||||
[Required]
|
||||
public Version ServerVersion { get; set; }
|
||||
public Version ServerVersion { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SwarmRegistrationRequest"/> class.
|
||||
/// </summary>
|
||||
/// <param name="serverVersion">The value of <see cref="ServerVersion"/>.</param>
|
||||
public SwarmRegistrationRequest(Version serverVersion)
|
||||
{
|
||||
ServerVersion = serverVersion ?? throw new ArgumentNullException(nameof(serverVersion));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1267,9 +1267,8 @@ namespace Tgstation.Server.Host.Swarm
|
||||
null,
|
||||
HttpMethod.Post,
|
||||
SwarmConstants.RegisterRoute,
|
||||
new SwarmRegistrationRequest
|
||||
new SwarmRegistrationRequest(assemblyInformationProvider.Version)
|
||||
{
|
||||
ServerVersion = assemblyInformationProvider.Version,
|
||||
Identifier = swarmConfiguration.Identifier,
|
||||
Address = swarmConfiguration.Address,
|
||||
PublicAddress = swarmConfiguration.PublicAddress,
|
||||
|
||||
Reference in New Issue
Block a user