Admin notes bugfixes (#18189)
This commit is contained in:
committed by
GitHub
parent
703f3d8bc6
commit
b4b0fe41db
@@ -31,6 +31,13 @@ public sealed class BanListEui : BaseEui
|
||||
_admins.OnPermsChanged += OnPermsChanged;
|
||||
}
|
||||
|
||||
public override void Closed()
|
||||
{
|
||||
base.Closed();
|
||||
|
||||
_admins.OnPermsChanged -= OnPermsChanged;
|
||||
}
|
||||
|
||||
public override EuiStateBase GetNewState()
|
||||
{
|
||||
return new BanListEuiState(BanListPlayerName, Bans);
|
||||
@@ -42,10 +49,6 @@ public sealed class BanListEui : BaseEui
|
||||
{
|
||||
Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
StateDirty();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task LoadFromDb()
|
||||
|
||||
@@ -99,8 +99,6 @@ public sealed class DepartmentBanCommand : IConsoleCommand
|
||||
{
|
||||
_banManager.CreateRoleBan(targetUid, located.Username, shell.Player?.UserId, null, targetHWid, job, minutes, severity, reason, now);
|
||||
}
|
||||
|
||||
_banManager.SendRoleBans(located.UserId);
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Content.Server.Administration.Managers;
|
||||
using Content.Shared.Administration;
|
||||
@@ -87,7 +87,6 @@ public sealed class RoleBanCommand : IConsoleCommand
|
||||
var targetHWid = located.LastHWId;
|
||||
|
||||
_bans.CreateRoleBan(targetUid, located.Username, shell.Player?.UserId, null, targetHWid, job, minutes, severity, reason, DateTimeOffset.UtcNow);
|
||||
_bans.SendRoleBans(located.UserId);
|
||||
}
|
||||
|
||||
public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
|
||||
|
||||
@@ -40,6 +40,8 @@ public sealed class BanManager : IBanManager, IPostInjectInit
|
||||
public void Initialize()
|
||||
{
|
||||
_playerManager.PlayerStatusChanged += OnPlayerStatusChanged;
|
||||
|
||||
_netManager.RegisterNetMessage<MsgRoleBans>();
|
||||
}
|
||||
|
||||
private async void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
|
||||
@@ -212,6 +214,11 @@ public sealed class BanManager : IBanManager, IPostInjectInit
|
||||
|
||||
var length = expires == null ? Loc.GetString("cmd-roleban-inf") : Loc.GetString("cmd-roleban-until", ("expires", expires));
|
||||
_chat.SendAdminAlert(Loc.GetString("cmd-roleban-success", ("target", targetUsername ?? "null"), ("role", role), ("reason", reason), ("length", length)));
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
SendRoleBans(target.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public HashSet<string>? GetJobBans(NetUserId playerUserId)
|
||||
|
||||
Reference in New Issue
Block a user