Better notes and bans (#14228)
Co-authored-by: Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
This commit is contained in:
61
Content.Shared/Administration/BanPanelEuiState.cs
Normal file
61
Content.Shared/Administration/BanPanelEuiState.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using System.Collections.Immutable;
|
||||
using Content.Shared.Database;
|
||||
using Content.Shared.Eui;
|
||||
using Robust.Shared.Serialization;
|
||||
using System.Net;
|
||||
|
||||
namespace Content.Shared.Administration;
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BanPanelEuiState : EuiStateBase
|
||||
{
|
||||
public string PlayerName { get; set; }
|
||||
public bool HasBan { get; set; }
|
||||
|
||||
public BanPanelEuiState(string playerName, bool hasBan)
|
||||
{
|
||||
PlayerName = playerName;
|
||||
HasBan = hasBan;
|
||||
}
|
||||
}
|
||||
|
||||
public static class BanPanelEuiStateMsg
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class CreateBanRequest : EuiMessageBase
|
||||
{
|
||||
public string? Player { get; set; }
|
||||
public string? IpAddress { get; set; }
|
||||
public byte[]? Hwid { get; set; }
|
||||
public uint Minutes { get; set; }
|
||||
public string Reason { get; set; }
|
||||
public NoteSeverity Severity { get; set; }
|
||||
public string[]? Roles { get; set; }
|
||||
public bool UseLastIp { get; set; }
|
||||
public bool UseLastHwid { get; set; }
|
||||
|
||||
public CreateBanRequest(string? player, (IPAddress, int)? ipAddress, bool useLastIp, byte[]? hwid, bool useLastHwid, uint minutes, string reason, NoteSeverity severity, string[]? roles)
|
||||
{
|
||||
Player = player;
|
||||
IpAddress = ipAddress == null ? null : $"{ipAddress.Value.Item1}/{ipAddress.Value.Item2}";
|
||||
UseLastIp = useLastIp;
|
||||
Hwid = hwid;
|
||||
UseLastHwid = useLastHwid;
|
||||
Minutes = minutes;
|
||||
Reason = reason;
|
||||
Severity = severity;
|
||||
Roles = roles;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class GetPlayerInfoRequest : EuiMessageBase
|
||||
{
|
||||
public string PlayerUsername { get; set; }
|
||||
|
||||
public GetPlayerInfoRequest(string username)
|
||||
{
|
||||
PlayerUsername = username;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user