Client count is unsigned for the love of god

This commit is contained in:
Jordan Dominion
2024-09-03 23:22:31 -04:00
parent f2e87b0b15
commit 7415005d6e
5 changed files with 6 additions and 6 deletions
@@ -23,7 +23,7 @@ namespace Tgstation.Server.Api.Models.Internal
/// The last known count of connected players. Requires <see cref="DreamDaemonLaunchParameters.HealthCheckSeconds"/> to not be 0 and a game server interop version >= 5.10.0 to populate.
/// </summary>
[ResponseOptions]
public int? ClientCount { get; set; }
public uint? ClientCount { get; set; }
/// <summary>
/// If the server is undergoing a soft reset. This may be automatically set by changes to other fields.
@@ -40,6 +40,6 @@ namespace Tgstation.Server.Host.Components.Interop.Topic
/// <summary>
/// The number of connected clients to the game. Added in Interop 5.10.0.
/// </summary>
public int? ClientCount { get; set; }
public uint? ClientCount { get; set; }
}
}
@@ -27,7 +27,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
/// <summary>
/// Last known client count queried from the DMAPI. Requires health checks to be enabled to populate.
/// </summary>
int? ClientCount { get; }
uint? ClientCount { get; }
/// <summary>
/// The current <see cref="WatchdogStatus"/>.
@@ -39,7 +39,7 @@ namespace Tgstation.Server.Host.Components.Watchdog
public long? SessionId => GetActiveController()?.ReattachInformation.Id;
/// <inheritdoc />
public int? ClientCount { get; private set; }
public uint? ClientCount { get; private set; }
/// <inheritdoc />
public DateTimeOffset? LaunchTime => GetActiveController()?.LaunchTime;
@@ -754,7 +754,7 @@ namespace Tgstation.Server.Tests.Live.Instance
Assert.IsTrue(daemonStatus.LaunchTime.Value >= DateTimeOffset.UtcNow.AddHours(-1));
if (daemonStatus.ClientCount.HasValue)
Assert.AreEqual(0, daemonStatus.ClientCount.Value);
Assert.AreEqual(0U, daemonStatus.ClientCount.Value);
if (sessionIdTracker.HasValue)
if (knownIncrease.HasValue)
@@ -865,7 +865,7 @@ namespace Tgstation.Server.Tests.Live.Instance
await Task.WhenAny(Task.Delay(7000, cancellationToken), ourProcessHandler.Lifetime);
Assert.IsFalse(ddProc.HasExited);
var daemonStatus = await instanceClient.DreamDaemon.Read(cancellationToken);
Assert.AreEqual(0, daemonStatus.ClientCount);
Assert.AreEqual(0U, daemonStatus.ClientCount);
// check DD agrees
var topicRequestResult = await SendTestTopic(