includes deadmined admins in adminsystem playerlist updates

This commit is contained in:
Paul
2021-11-10 18:09:22 +01:00
parent 478607ceff
commit 58fc8ee35f
3 changed files with 9 additions and 2 deletions

View File

@@ -76,12 +76,12 @@ namespace Content.Server.Administration
if(args == null) return;
foreach (var admin in _adminManager.ActiveAdmins)
foreach (var admin in _adminManager.AllAdmins)
{
RaiseNetworkEvent(args, admin.ConnectedClient);
}
if (e.NewStatus != SessionStatus.Disconnected && _adminManager.IsAdmin(e.Session))
if (e.NewStatus != SessionStatus.Disconnected && _adminManager.IsAdmin(e.Session, true))
{
SendFullPlayerList(e.Session);
}

View File

@@ -44,6 +44,8 @@ namespace Content.Server.Administration.Managers
.Where(p => p.Value.Data.Active)
.Select(p => p.Key);
public IEnumerable<IPlayerSession> AllAdmins => _admins.Select(p => p.Key);
// If a command isn't in this list it's server-console only.
// if a command is in but the flags value is null it's available to everybody.
private readonly HashSet<string> _anyCommands = new();

View File

@@ -24,6 +24,11 @@ namespace Content.Server.Administration.Managers
/// </remarks>
IEnumerable<IPlayerSession> ActiveAdmins { get; }
/// <summary>
/// Gets all admins currently on the server, even de-adminned ones.
/// </summary>
IEnumerable<IPlayerSession> AllAdmins { get; }
/// <summary>
/// Checks if a player is an admin.
/// </summary>