using System.Collections.Immutable; using System.Net; using System.Threading.Tasks; using Content.Shared.Database; using Content.Shared.Roles; using Robust.Shared.Network; using Robust.Shared.Player; using Robust.Shared.Prototypes; namespace Content.Server.Administration.Managers; public interface IBanManager { public void Initialize(); public void Restart(); /// /// Bans the specified target, address range and / or HWID. One of them must be non-null /// /// Target user, username or GUID, null for none /// The person who banned our target /// Address range, null for none /// H /// Number of minutes to ban for. 0 and null mean permanent /// Severity of the resulting ban note /// Reason for the ban public void CreateServerBan(NetUserId? target, string? targetUsername, NetUserId? banningAdmin, (IPAddress, int)? addressRange, ImmutableTypedHwid? hwid, uint? minutes, NoteSeverity severity, string reason); public HashSet? GetRoleBans(NetUserId playerUserId); public HashSet>? GetJobBans(NetUserId playerUserId); /// /// Creates a job ban for the specified target, username or GUID /// /// Target user, username or GUID, null for none /// Role to be banned from /// Severity of the resulting ban note /// Reason for the ban /// Number of minutes to ban for. 0 and null mean permanent /// Time when the ban was applied, used for grouping role bans public void CreateRoleBan(NetUserId? target, string? targetUsername, NetUserId? banningAdmin, (IPAddress, int)? addressRange, ImmutableTypedHwid? hwid, string role, uint? minutes, NoteSeverity severity, string reason, DateTimeOffset timeOfBan); /// /// Pardons a role ban for the specified target, username or GUID /// /// The id of the role ban to pardon. /// The admin, if any, that pardoned the role ban. /// The time at which this role ban was pardoned. public Task PardonRoleBan(int banId, NetUserId? unbanningAdmin, DateTimeOffset unbanTime); /// /// Sends role bans to the target /// /// Player's session public void SendRoleBans(ICommonSession pSession); }