adminmenu fixes (#5305)
This commit is contained in:
@@ -2,6 +2,8 @@ using System;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Server.Players;
|
||||
using Content.Server.Roles;
|
||||
using Content.Server.Traitor;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.Administration.Events;
|
||||
using Robust.Server.GameObjects;
|
||||
@@ -25,11 +27,28 @@ namespace Content.Server.Administration
|
||||
_adminManager.OnPermsChanged += OnAdminPermsChanged;
|
||||
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
|
||||
SubscribeLocalEvent<RoleAddedEvent>(OnRoleAddedEvent);
|
||||
}
|
||||
|
||||
private void OnRoleAddedEvent(RoleAddedEvent ev)
|
||||
{
|
||||
if (ev.Role.Antagonist && ev.Role.Mind.Session != null)
|
||||
{
|
||||
foreach (var admin in _adminManager.ActiveAdmins)
|
||||
{
|
||||
RaiseNetworkEvent(GetChangedEvent(ev.Role.Mind.Session), admin.ConnectedClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnAdminPermsChanged(AdminPermsChangedEventArgs obj)
|
||||
{
|
||||
if(!obj.IsAdmin) return;
|
||||
if(!obj.IsAdmin)
|
||||
{
|
||||
RaiseNetworkEvent(new FullPlayerListEvent(), obj.Player.ConnectedClient);
|
||||
return;
|
||||
}
|
||||
|
||||
SendFullPlayerList(obj.Player);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user