|
@@ -3,6 +3,7 @@
|
|
|
using Content.Shared.CCVar;
|
|
using Content.Shared.CCVar;
|
|
|
using Content.Shared.GameTicking;
|
|
using Content.Shared.GameTicking;
|
|
|
using Robust.Server.ServerStatus;
|
|
using Robust.Server.ServerStatus;
|
|
|
|
|
+using Robust.Shared.Collections;
|
|
|
using Robust.Shared.Configuration;
|
|
using Robust.Shared.Configuration;
|
|
|
|
|
|
|
|
namespace Content.Server.GameTicking
|
|
namespace Content.Server.GameTicking
|
|
@@ -37,7 +38,12 @@ private void InitializeStatusShell()
|
|
|
private void GetStatusResponse(JsonNode jObject)
|
|
private void GetStatusResponse(JsonNode jObject)
|
|
|
{
|
|
{
|
|
|
var preset = CurrentPreset ?? Preset;
|
|
var preset = CurrentPreset ?? Preset;
|
|
|
|
|
+ var _parsedPlayerList = new ValueList<JsonNode>();
|
|
|
|
|
+ foreach (var player in _playerManager.Sessions)
|
|
|
|
|
+ {
|
|
|
|
|
+ _parsedPlayerList.Add(JsonValue.Create(player.Name.ToString())!);
|
|
|
|
|
|
|
|
|
|
+ }
|
|
|
// 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)
|
|
|
{
|
|
{
|
|
@@ -49,13 +55,14 @@ private void GetStatusResponse(JsonNode jObject)
|
|
|
: _playerManager.PlayerCount - _adminManager.ActiveAdmins.Count();
|
|
: _playerManager.PlayerCount - _adminManager.ActiveAdmins.Count();
|
|
|
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)
|
|
if (preset != null)
|
|
|
jObject["preset"] = Loc.GetString(preset.ModeTitle);
|
|
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");
|
|
|
}
|
|
}
|
|
|
|
|
+ jObject["playerlist"] = new JsonArray(_parsedPlayerList.ToArray());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|