51 lines
2.5 KiB
C#
51 lines
2.5 KiB
C#
using System.Collections.Immutable;
|
|
using Content.Shared.Database;
|
|
using Robust.Server.Player;
|
|
using Robust.Shared.Network;
|
|
using System.Net;
|
|
|
|
namespace Content.Server.Administration.Managers;
|
|
|
|
public interface IBanManager
|
|
{
|
|
public void Initialize();
|
|
public void Restart();
|
|
|
|
/// <summary>
|
|
/// Bans the specified target, address range and / or HWID. One of them must be non-null
|
|
/// </summary>
|
|
/// <param name="target">Target user, username or GUID, null for none</param>
|
|
/// <param name="banningAdmin">The person who banned our target</param>
|
|
/// <param name="addressRange">Address range, null for none</param>
|
|
/// <param name="hwid">H</param>
|
|
/// <param name="minutes">Number of minutes to ban for. 0 and null mean permanent</param>
|
|
/// <param name="severity">Severity of the resulting ban note</param>
|
|
/// <param name="reason">Reason for the ban</param>
|
|
public void CreateServerBan(NetUserId? target, string? targetUsername, NetUserId? banningAdmin, (IPAddress, int)? addressRange, ImmutableArray<byte>? hwid, uint? minutes, NoteSeverity severity, string reason);
|
|
public HashSet<string>? GetRoleBans(NetUserId playerUserId);
|
|
public HashSet<string>? GetJobBans(NetUserId playerUserId);
|
|
/// <summary>
|
|
/// Creates a job ban for the specified target, username or GUID
|
|
/// </summary>
|
|
/// <param name="shell">Shell reference so we can write messages</param>
|
|
/// <param name="target">Target user, username or GUID, null for none</param>
|
|
/// <param name="job">Job to be banned from</param>
|
|
/// <param name="severity">Severity of the resulting ban note</param>
|
|
/// <param name="reason">Reason for the ban</param>
|
|
/// <param name="minutes">Number of minutes to ban for. 0 and null mean permanent</param>
|
|
/// <param name="timeOfBan">Time when the ban was applied, used for grouping role bans</param>
|
|
public void CreateRoleBan(NetUserId? target, string? targetUsername, NetUserId? banningAdmin, (IPAddress, int)? addressRange, ImmutableArray<byte>? hwid, string role, uint? minutes, NoteSeverity severity, string reason, DateTimeOffset timeOfBan);
|
|
|
|
/// <summary>
|
|
/// Sends role bans to the target
|
|
/// </summary>
|
|
/// <param name="pSession">Player's user ID</param>
|
|
public void SendRoleBans(NetUserId userId);
|
|
|
|
/// <summary>
|
|
/// Sends role bans to the target
|
|
/// </summary>
|
|
/// <param name="pSession">Player's session</param>
|
|
public void SendRoleBans(IPlayerSession pSession);
|
|
}
|