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);
///
/// Gets a list of prefixed prototype IDs with the player's role bans.
///
public HashSet? GetRoleBans(NetUserId playerUserId);
///
/// Checks if the player is currently banned from any of the listed roles.
///
/// The player.
/// A list of valid antag prototype IDs.
/// Returns True if an active role ban is found for this player for any of the listed roles.
public bool IsRoleBanned(ICommonSession player, List> antags);
///
/// Checks if the player is currently banned from any of the listed roles.
///
/// The player.
/// A list of valid job prototype IDs.
/// Returns True if an active role ban is found for this player for any of the listed roles.
public bool IsRoleBanned(ICommonSession player, List> jobs);
///
/// Gets a list of prototype IDs with the player's job bans.
///
public HashSet>? GetJobBans(NetUserId playerUserId);
///
/// Gets a list of prototype IDs with the player's antag bans.
///
public HashSet>? GetAntagBans(NetUserId playerUserId);
///
/// Creates a job ban for the specified target, username or GUID
///
/// Target user, username or GUID, null for none
/// The username of the target, if known
/// The responsible admin for the ban
/// The range of IPs that are to be banned, if known
/// The HWID to be banned, if known
/// The role ID to be banned from. Either an AntagPrototype or a JobPrototype
/// Number of minutes to ban for. 0 and null mean permanent
/// Severity of the resulting ban note
/// Reason for the ban
/// 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,
ProtoId role,
uint? minutes,
NoteSeverity severity,
string reason,
DateTimeOffset timeOfBan
) where T : class, IPrototype;
///
/// 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);
}