From 7750675757dca8bd6b2f8ae2a45dfe26a2e337d7 Mon Sep 17 00:00:00 2001 From: Aerocrux <69610864+Aerocrux@users.noreply.github.com> Date: Fri, 8 Jul 2022 12:44:49 -0700 Subject: [PATCH] Add SoftMaxPlayers to status response for launcher use (#9365) --- Content.Server/GameTicking/GameTicker.StatusShell.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Content.Server/GameTicking/GameTicker.StatusShell.cs b/Content.Server/GameTicking/GameTicker.StatusShell.cs index 8d2501b58b..e2da4d0995 100644 --- a/Content.Server/GameTicking/GameTicker.StatusShell.cs +++ b/Content.Server/GameTicking/GameTicker.StatusShell.cs @@ -1,5 +1,7 @@ using System.Text.Json.Nodes; +using Content.Shared.CCVar; using Robust.Server.ServerStatus; +using Robust.Shared.Configuration; namespace Content.Server.GameTicking { @@ -16,6 +18,11 @@ namespace Content.Server.GameTicking [ViewVariables] private DateTime _roundStartDateTime; + /// + /// For access to CVars in status responses. + /// + [Dependency] private readonly IConfigurationManager _cfg = default!; + private void InitializeStatusShell() { IoCManager.Resolve().OnStatusRequest += GetStatusResponse; @@ -28,6 +35,7 @@ namespace Content.Server.GameTicking { jObject["name"] = _baseServer.ServerName; jObject["players"] = _playerManager.PlayerCount; + jObject["soft_max_players"] = _cfg.GetCVar(CCVars.SoftMaxPlayers); jObject["run_level"] = (int) _runLevel; if (_runLevel >= GameRunLevel.InRound) {