]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add round ID to status HTTP API (#21904)
authorSimon <63975668+Simyon264@users.noreply.github.com>
Sun, 26 Nov 2023 19:54:43 +0000 (20:54 +0100)
committerGitHub <noreply@github.com>
Sun, 26 Nov 2023 19:54:43 +0000 (13:54 -0600)
* added round_id

* Update Content.Server/GameTicking/GameTicker.StatusShell.cs

Co-authored-by: 0x6273 <0x40@keemail.me>
---------

Co-authored-by: Moony <moony@hellomouse.net>
Co-authored-by: 0x6273 <0x40@keemail.me>
Content.Server/GameTicking/GameTicker.StatusShell.cs

index d611795e88a1033d763e6b3e5717468d422f9485..7d16f2ede2e63980b2e22e17f870407883a08d40 100644 (file)
@@ -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.
         /// </summary>
         [Dependency] private readonly IConfigurationManager _cfg = default!;
-
+        /// <summary>
+        ///     For access to the round ID in status responses.
+        /// </summary>
+        [Dependency] private readonly SharedGameTicker _gameTicker = default!;
+        
         private void InitializeStatusShell()
         {
             IoCManager.Resolve<IStatusHost>().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;