Add SoftMaxPlayers to status response for launcher use (#9365)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
using System.Text.Json.Nodes;
|
using System.Text.Json.Nodes;
|
||||||
|
using Content.Shared.CCVar;
|
||||||
using Robust.Server.ServerStatus;
|
using Robust.Server.ServerStatus;
|
||||||
|
using Robust.Shared.Configuration;
|
||||||
|
|
||||||
namespace Content.Server.GameTicking
|
namespace Content.Server.GameTicking
|
||||||
{
|
{
|
||||||
@@ -16,6 +18,11 @@ namespace Content.Server.GameTicking
|
|||||||
[ViewVariables]
|
[ViewVariables]
|
||||||
private DateTime _roundStartDateTime;
|
private DateTime _roundStartDateTime;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// For access to CVars in status responses.
|
||||||
|
/// </summary>
|
||||||
|
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||||
|
|
||||||
private void InitializeStatusShell()
|
private void InitializeStatusShell()
|
||||||
{
|
{
|
||||||
IoCManager.Resolve<IStatusHost>().OnStatusRequest += GetStatusResponse;
|
IoCManager.Resolve<IStatusHost>().OnStatusRequest += GetStatusResponse;
|
||||||
@@ -28,6 +35,7 @@ namespace Content.Server.GameTicking
|
|||||||
{
|
{
|
||||||
jObject["name"] = _baseServer.ServerName;
|
jObject["name"] = _baseServer.ServerName;
|
||||||
jObject["players"] = _playerManager.PlayerCount;
|
jObject["players"] = _playerManager.PlayerCount;
|
||||||
|
jObject["soft_max_players"] = _cfg.GetCVar(CCVars.SoftMaxPlayers);
|
||||||
jObject["run_level"] = (int) _runLevel;
|
jObject["run_level"] = (int) _runLevel;
|
||||||
if (_runLevel >= GameRunLevel.InRound)
|
if (_runLevel >= GameRunLevel.InRound)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user