From 2563eb6f50b50ef116f0b4e77c6a8b5e800364fe Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Wed, 17 Apr 2024 00:19:36 +0200 Subject: [PATCH] Re-add IAdminRemarksCommon to DB model for SS14.Admin (#27028) This was removed in #25280 as the relevant DB entities didn't go outside the DB layer anymore. SS14.Admin however still uses them directly (as it only supports Postgres), so the interface is still useful there. (cherry picked from commit bbf0505fdc0f49a40a66473296f912cb4d580cb9) --- Content.Server.Database/Model.cs | 33 +++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/Content.Server.Database/Model.cs b/Content.Server.Database/Model.cs index 2e13c2a2f6..2283b5b535 100644 --- a/Content.Server.Database/Model.cs +++ b/Content.Server.Database/Model.cs @@ -875,8 +875,35 @@ namespace Content.Server.Database public byte[] Data { get; set; } = default!; } + // Note: this interface isn't used by the game, but it *is* used by SS14.Admin. + // Don't remove! Or face the consequences! + public interface IAdminRemarksCommon + { + public int Id { get; } + + public int? RoundId { get; } + public Round? Round { get; } + + public Guid? PlayerUserId { get; } + public Player? Player { get; } + public TimeSpan PlaytimeAtNote { get; } + + public string Message { get; } + + public Player? CreatedBy { get; } + + public DateTime CreatedAt { get; } + + public Player? LastEditedBy { get; } + + public DateTime? LastEditedAt { get; } + public DateTime? ExpirationTime { get; } + + public bool Deleted { get; } + } + [Index(nameof(PlayerUserId))] - public class AdminNote + public class AdminNote : IAdminRemarksCommon { [Required, Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } @@ -910,7 +937,7 @@ namespace Content.Server.Database } [Index(nameof(PlayerUserId))] - public class AdminWatchlist + public class AdminWatchlist : IAdminRemarksCommon { [Required, Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } @@ -941,7 +968,7 @@ namespace Content.Server.Database } [Index(nameof(PlayerUserId))] - public class AdminMessage + public class AdminMessage : IAdminRemarksCommon { [Required, Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; }