]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Expose preset in status (#23586)
authorVasilis <vasilis@pikachu.systems>
Sat, 6 Jan 2024 03:14:25 +0000 (04:14 +0100)
committerGitHub <noreply@github.com>
Sat, 6 Jan 2024 03:14:25 +0000 (14:14 +1100)
Content.Server/GameTicking/GameTicker.StatusShell.cs

index 61173b6f9a7acd075e0eed53312ae1455bb56289..fcf5b1c25cd7e6f9c4c91a8a12344222b5cccdea 100644 (file)
@@ -27,7 +27,7 @@ namespace Content.Server.GameTicking
         ///     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 +35,8 @@ namespace Content.Server.GameTicking
 
         private void GetStatusResponse(JsonNode jObject)
         {
+            var preset = CurrentPreset ?? Preset;
+
             // This method is raised from another thread, so this better be thread safe!
             lock (_statusShellLock)
             {
@@ -45,6 +47,8 @@ namespace Content.Server.GameTicking
                 jObject["soft_max_players"] = _cfg.GetCVar(CCVars.SoftMaxPlayers);
                 jObject["panic_bunker"] = _cfg.GetCVar(CCVars.PanicBunkerEnabled);
                 jObject["run_level"] = (int) _runLevel;
+                if (preset != null)
+                    jObject["preset"] = Loc.GetString(preset.ModeTitle);
                 if (_runLevel >= GameRunLevel.InRound)
                 {
                     jObject["round_start_time"] = _roundStartDateTime.ToString("o");