From 14b8762bf3760546e03f5101c026185f8c62a51a Mon Sep 17 00:00:00 2001 From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Sun, 26 Nov 2023 20:54:43 +0100 Subject: [PATCH] Add round ID to status HTTP API (#21904) * added round_id * Update Content.Server/GameTicking/GameTicker.StatusShell.cs Co-authored-by: 0x6273 <0x40@keemail.me> --------- Co-authored-by: Moony Co-authored-by: 0x6273 <0x40@keemail.me> --- Content.Server/GameTicking/GameTicker.StatusShell.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameTicking/GameTicker.StatusShell.cs b/Content.Server/GameTicking/GameTicker.StatusShell.cs index d611795e88..7d16f2ede2 100644 --- a/Content.Server/GameTicking/GameTicker.StatusShell.cs +++ b/Content.Server/GameTicking/GameTicker.StatusShell.cs @@ -1,5 +1,6 @@ using System.Text.Json.Nodes; using Content.Shared.CCVar; +using Content.Shared.GameTicking; using Robust.Server.ServerStatus; using Robust.Shared.Configuration; @@ -22,7 +23,11 @@ namespace Content.Server.GameTicking /// For access to CVars in status responses. /// [Dependency] private readonly IConfigurationManager _cfg = default!; - + /// + /// For access to the round ID in status responses. + /// + [Dependency] private readonly SharedGameTicker _gameTicker = default!; + private void InitializeStatusShell() { IoCManager.Resolve().OnStatusRequest += GetStatusResponse; @@ -35,6 +40,7 @@ namespace Content.Server.GameTicking { jObject["name"] = _baseServer.ServerName; jObject["map"] = _gameMapManager.GetSelectedMap()?.MapName; + jObject["round_id"] = _gameTicker.RoundId; jObject["players"] = _playerManager.PlayerCount; jObject["soft_max_players"] = _cfg.GetCVar(CCVars.SoftMaxPlayers); jObject["run_level"] = (int) _runLevel;