Skip to content

Commit

Permalink
Shared interfaces for server and role ban entities (#14730)
Browse files Browse the repository at this point in the history
  • Loading branch information
PJB3005 authored Mar 18, 2023
1 parent a37ed23 commit 360a507
Showing 1 changed file with 27 additions and 4 deletions.
31 changes: 27 additions & 4 deletions Content.Server.Database/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,31 @@ public class AdminLogEntity
public string? Name { get; set; } = default!;
}

// Used by SS14.Admin
public interface IBanCommon<TUnban> where TUnban : IUnbanCommon
{
int Id { get; set; }
Guid? UserId { get; set; }
(IPAddress, int)? Address { get; set; }
byte[]? HWId { get; set; }
DateTime BanTime { get; set; }
DateTime? ExpirationTime { get; set; }
string Reason { get; set; }
Guid? BanningAdmin { get; set; }
TUnban? Unban { get; set; }
}

// Used by SS14.Admin
public interface IUnbanCommon
{
int Id { get; set; }
int BanId { get; set; }
Guid? UnbanningAdmin { get; set; }
DateTime UnbanTime { get; set; }
}

[Table("server_ban")]
public class ServerBan
public class ServerBan : IBanCommon<ServerUnban>
{
public int Id { get; set; }
public Guid? UserId { get; set; }
Expand All @@ -438,7 +461,7 @@ public class ServerBan
}

[Table("server_unban")]
public class ServerUnban
public class ServerUnban : IUnbanCommon
{
[Column("unban_id")] public int Id { get; set; }

Expand Down Expand Up @@ -488,7 +511,7 @@ public class ServerBanHit
}

[Table("server_role_ban")]
public sealed class ServerRoleBan
public sealed class ServerRoleBan : IBanCommon<ServerRoleUnban>
{
public int Id { get; set; }
public Guid? UserId { get; set; }
Expand All @@ -508,7 +531,7 @@ public sealed class ServerRoleBan
}

[Table("server_role_unban")]
public sealed class ServerRoleUnban
public sealed class ServerRoleUnban : IUnbanCommon
{
[Column("role_unban_id")] public int Id { get; set; }

Expand Down

0 comments on commit 360a507

Please sign in to comment.