BanPanelEuiState.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System.Net;
  2. using Content.Shared.Database;
  3. using Content.Shared.Eui;
  4. using Robust.Shared.Serialization;
  5. namespace Content.Shared.Administration;
  6. [Serializable, NetSerializable]
  7. public sealed class BanPanelEuiState : EuiStateBase
  8. {
  9. public string PlayerName { get; set; }
  10. public bool HasBan { get; set; }
  11. public BanPanelEuiState(string playerName, bool hasBan)
  12. {
  13. PlayerName = playerName;
  14. HasBan = hasBan;
  15. }
  16. }
  17. public static class BanPanelEuiStateMsg
  18. {
  19. [Serializable, NetSerializable]
  20. public sealed class CreateBanRequest : EuiMessageBase
  21. {
  22. public string? Player { get; set; }
  23. public string? IpAddress { get; set; }
  24. public ImmutableTypedHwid? Hwid { get; set; }
  25. public uint Minutes { get; set; }
  26. public string Reason { get; set; }
  27. public NoteSeverity Severity { get; set; }
  28. public string[]? Roles { get; set; }
  29. public bool UseLastIp { get; set; }
  30. public bool UseLastHwid { get; set; }
  31. public bool Erase { get; set; }
  32. public CreateBanRequest(string? player, (IPAddress, int)? ipAddress, bool useLastIp, ImmutableTypedHwid? hwid, bool useLastHwid, uint minutes, string reason, NoteSeverity severity, string[]? roles, bool erase)
  33. {
  34. Player = player;
  35. IpAddress = ipAddress == null ? null : $"{ipAddress.Value.Item1}/{ipAddress.Value.Item2}";
  36. UseLastIp = useLastIp;
  37. Hwid = hwid;
  38. UseLastHwid = useLastHwid;
  39. Minutes = minutes;
  40. Reason = reason;
  41. Severity = severity;
  42. Roles = roles;
  43. Erase = erase;
  44. }
  45. }
  46. [Serializable, NetSerializable]
  47. public sealed class GetPlayerInfoRequest : EuiMessageBase
  48. {
  49. public string PlayerUsername { get; set; }
  50. public GetPlayerInfoRequest(string username)
  51. {
  52. PlayerUsername = username;
  53. }
  54. }
  55. }