Add banlist command (#3163)

* Add banlist command

* Fix up args
This commit is contained in:
DrSmugleaf
2021-02-12 13:04:32 +01:00
committed by GitHub
parent 6eb0dd4f50
commit 9f5fca2334
7 changed files with 191 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ namespace Content.Server.Database
{
public sealed class ServerBanDef
{
public int? Id { get; }
public NetUserId? UserId { get; }
public (IPAddress address, int cidrMask)? Address { get; }
@@ -16,7 +17,7 @@ namespace Content.Server.Database
public string Reason { get; }
public NetUserId? BanningAdmin { get; }
public ServerBanDef(NetUserId? userId, (IPAddress, int)? address, DateTimeOffset banTime, DateTimeOffset? expirationTime, string reason, NetUserId? banningAdmin)
public ServerBanDef(int? id, NetUserId? userId, (IPAddress, int)? address, DateTimeOffset banTime, DateTimeOffset? expirationTime, string reason, NetUserId? banningAdmin)
{
if (userId == null && address == null)
{
@@ -30,6 +31,7 @@ namespace Content.Server.Database
address = (addr.Item1.MapToIPv4(), addr.Item2 - 96);
}
Id = id;
UserId = userId;
Address = address;
BanTime = banTime;