1
0

IBanManager.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Collections.Immutable;
  2. using System.Net;
  3. using System.Threading.Tasks;
  4. using Content.Shared.Database;
  5. using Content.Shared.Roles;
  6. using Robust.Shared.Network;
  7. using Robust.Shared.Player;
  8. using Robust.Shared.Prototypes;
  9. namespace Content.Server.Administration.Managers;
  10. public interface IBanManager
  11. {
  12. public void Initialize();
  13. public void Restart();
  14. /// <summary>
  15. /// Bans the specified target, address range and / or HWID. One of them must be non-null
  16. /// </summary>
  17. /// <param name="target">Target user, username or GUID, null for none</param>
  18. /// <param name="banningAdmin">The person who banned our target</param>
  19. /// <param name="addressRange">Address range, null for none</param>
  20. /// <param name="hwid">H</param>
  21. /// <param name="minutes">Number of minutes to ban for. 0 and null mean permanent</param>
  22. /// <param name="severity">Severity of the resulting ban note</param>
  23. /// <param name="reason">Reason for the ban</param>
  24. public void CreateServerBan(NetUserId? target, string? targetUsername, NetUserId? banningAdmin, (IPAddress, int)? addressRange, ImmutableTypedHwid? hwid, uint? minutes, NoteSeverity severity, string reason);
  25. public HashSet<string>? GetRoleBans(NetUserId playerUserId);
  26. public HashSet<ProtoId<JobPrototype>>? GetJobBans(NetUserId playerUserId);
  27. /// <summary>
  28. /// Creates a job ban for the specified target, username or GUID
  29. /// </summary>
  30. /// <param name="target">Target user, username or GUID, null for none</param>
  31. /// <param name="role">Role to be banned from</param>
  32. /// <param name="severity">Severity of the resulting ban note</param>
  33. /// <param name="reason">Reason for the ban</param>
  34. /// <param name="minutes">Number of minutes to ban for. 0 and null mean permanent</param>
  35. /// <param name="timeOfBan">Time when the ban was applied, used for grouping role bans</param>
  36. public void CreateRoleBan(NetUserId? target, string? targetUsername, NetUserId? banningAdmin, (IPAddress, int)? addressRange, ImmutableTypedHwid? hwid, string role, uint? minutes, NoteSeverity severity, string reason, DateTimeOffset timeOfBan);
  37. /// <summary>
  38. /// Pardons a role ban for the specified target, username or GUID
  39. /// </summary>
  40. /// <param name="banId">The id of the role ban to pardon.</param>
  41. /// <param name="unbanningAdmin">The admin, if any, that pardoned the role ban.</param>
  42. /// <param name="unbanTime">The time at which this role ban was pardoned.</param>
  43. public Task<string> PardonRoleBan(int banId, NetUserId? unbanningAdmin, DateTimeOffset unbanTime);
  44. /// <summary>
  45. /// Sends role bans to the target
  46. /// </summary>
  47. /// <param name="pSession">Player's session</param>
  48. public void SendRoleBans(ICommonSession pSession);
  49. }