Expose preset in status (#23586)

This commit is contained in:
Vasilis
2024-01-06 04:14:25 +01:00
committed by GitHub
parent 86c1e36cd5
commit a2fdad31ed

View File

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