+using System.Linq;
using System.Text.Json.Nodes;
using Content.Shared.CCVar;
using Content.Shared.GameTicking;
jObject["name"] = _baseServer.ServerName;
jObject["map"] = _gameMapManager.GetSelectedMap()?.MapName;
jObject["round_id"] = _gameTicker.RoundId;
- jObject["players"] = _playerManager.PlayerCount;
+ jObject["players"] = _cfg.GetCVar(CCVars.AdminsCountInReportedPlayerCount)
+ ? _playerManager.PlayerCount
+ : _playerManager.PlayerCount - _adminManager.ActiveAdmins.Count();
jObject["soft_max_players"] = _cfg.GetCVar(CCVars.SoftMaxPlayers);
jObject["panic_bunker"] = _cfg.GetCVar(CCVars.PanicBunkerEnabled);
jObject["run_level"] = (int) _runLevel;
public static readonly CVarDef<bool> AdminsCountForMaxPlayers =
CVarDef.Create("admin.admins_count_for_max_players", false, CVar.SERVERONLY);
+ /// <summary>
+ /// Should admins be hidden from the player count reported to the launcher/via api?
+ /// This is hub advert safe, in case that's a worry.
+ /// </summary>
+ public static readonly CVarDef<bool> AdminsCountInReportedPlayerCount =
+ CVarDef.Create("admin.admins_count_in_playercount", false, CVar.SERVERONLY);
+
/// <summary>
/// Determine if custom rank names are used.
/// If it is false, it'd use the actual rank name regardless of the individual's title.