# Conflicts: # Content.Client/Administration/UI/BanList/BanListLine.xaml.cs # Content.Client/Administration/UI/BanList/Bans/BanListHeader.xaml # Content.Client/Administration/UI/BanList/Bans/BanListLine.xaml # Content.Client/Administration/UI/Tabs/AdminTab/BanWindow.xaml # Content.Client/Administration/UI/Tabs/AdminTab/BanWindow.xaml.cs # Content.IntegrationTests/Tests/Commands/PardonCommand.cs # Content.Server/Administration/Commands/BanCommand.cs # Content.Server/Administration/Commands/DepartmentBanCommand.cs # Content.Server/Administration/Commands/RoleBanCommand.cs # Content.Server/Administration/Managers/RoleBanManager.cs # Content.Server/Database/ServerDbManager.cs # Content.Server/Database/ServerDbPostgres.cs # Content.Server/Database/ServerDbSqlite.cs
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using Content.Client.Eui;
|
|
using Content.Shared.Administration;
|
|
using Content.Shared.Eui;
|
|
using JetBrains.Annotations;
|
|
|
|
namespace Content.Client.Administration.UI.BanPanel;
|
|
|
|
[UsedImplicitly]
|
|
public sealed class BanPanelEui : BaseEui
|
|
{
|
|
private BanPanel BanPanel { get; }
|
|
|
|
public BanPanelEui()
|
|
{
|
|
BanPanel = new BanPanel();
|
|
BanPanel.OnClose += () => SendMessage(new CloseEuiMessage());
|
|
BanPanel.BanSubmitted += (player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, erase, isGlobalBan)
|
|
=> SendMessage(new BanPanelEuiStateMsg.CreateBanRequest(player, ip, useLastIp, hwid, useLastHwid, minutes, reason, severity, erase, isGlobalBan));
|
|
BanPanel.PlayerChanged += player => SendMessage(new BanPanelEuiStateMsg.GetPlayerInfoRequest(player));
|
|
}
|
|
|
|
public override void HandleState(EuiStateBase state)
|
|
{
|
|
if (state is not BanPanelEuiState s)
|
|
{
|
|
return;
|
|
}
|
|
|
|
BanPanel.UpdateBanFlag(s.HasBan);
|
|
BanPanel.UpdatePlayerData(s.PlayerName);
|
|
}
|
|
|
|
public override void Opened()
|
|
{
|
|
BanPanel.OpenCentered();
|
|
}
|
|
|
|
public override void Closed()
|
|
{
|
|
BanPanel.Close();
|
|
BanPanel.Dispose();
|
|
}
|
|
}
|