diff --git a/Content.Server.Database/Model.cs b/Content.Server.Database/Model.cs index c2d2ea98dc..298f849b47 100644 --- a/Content.Server.Database/Model.cs +++ b/Content.Server.Database/Model.cs @@ -517,6 +517,7 @@ namespace Content.Server.Database public List Players { get; set; } = default!; + // Unused public List Entities { get; set; } = default!; } @@ -530,6 +531,7 @@ namespace Content.Server.Database [ForeignKey("LogId,RoundId")] public AdminLog Log { get; set; } = default!; } + // Unused public class AdminLogEntity { [Required, Key] public int Uid { get; set; } diff --git a/Content.Server/Administration/Logs/AdminLogManager.Json.cs b/Content.Server/Administration/Logs/AdminLogManager.Json.cs index 43a1e0b8b5..63f30c7a66 100644 --- a/Content.Server/Administration/Logs/AdminLogManager.Json.cs +++ b/Content.Server/Administration/Logs/AdminLogManager.Json.cs @@ -2,7 +2,6 @@ using System.Text.Json; using System.Text.Json.Serialization; using Content.Server.Administration.Logs.Converters; -using Content.Server.Database; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Map; @@ -34,10 +33,9 @@ public sealed partial class AdminLogManager _sawmill.Debug($"Admin log converters found: {string.Join(" ", converterNames)}"); } - private (JsonDocument Json, HashSet Players, List Entities) ToJson( + private (JsonDocument Json, HashSet Players) ToJson( Dictionary properties) { - var entities = new Dictionary(); var players = new HashSet(); var parsed = new Dictionary(); @@ -63,24 +61,12 @@ public sealed partial class AdminLogManager _ => null }; - if (entityId is not { } uid) - { - continue; - } - - var entityName = _entityManager.TryGetComponent(uid, out MetaDataComponent? metadata) - ? metadata.EntityName - : null; - - // TODO set the id too whenever we feel like running a migration for 10 hours - entities.TryAdd(uid, new AdminLogEntity { Name = entityName }); - - if (_entityManager.TryGetComponent(uid, out ActorComponent? actor)) + if (_entityManager.TryGetComponent(entityId, out ActorComponent? actor)) { players.Add(actor.PlayerSession.UserId.UserId); } } - return (JsonSerializer.SerializeToDocument(parsed, _jsonOptions), players, entities.Values.ToList()); + return (JsonSerializer.SerializeToDocument(parsed, _jsonOptions), players); } } diff --git a/Content.Server/Administration/Logs/AdminLogManager.cs b/Content.Server/Administration/Logs/AdminLogManager.cs index 06f58f10b2..e869d089da 100644 --- a/Content.Server/Administration/Logs/AdminLogManager.cs +++ b/Content.Server/Administration/Logs/AdminLogManager.cs @@ -278,7 +278,7 @@ public sealed partial class AdminLogManager : SharedAdminLogManager, IAdminLogMa } } - private void Add(LogType type, LogImpact impact, string message, JsonDocument json, HashSet players, List entities) + private void Add(LogType type, LogImpact impact, string message, JsonDocument json, HashSet players) { var preRound = _runLevel == GameRunLevel.PreRoundLobby; var count = preRound ? _preRoundLogQueue.Count : _logQueue.Count; @@ -297,8 +297,7 @@ public sealed partial class AdminLogManager : SharedAdminLogManager, IAdminLogMa Date = DateTime.UtcNow, Message = message, Json = json, - Players = new List(players.Count), - Entities = entities + Players = new List(players.Count) }; foreach (var id in players) @@ -331,10 +330,10 @@ public sealed partial class AdminLogManager : SharedAdminLogManager, IAdminLogMa return; } - var (json, players, entities) = ToJson(handler.Values); + var (json, players) = ToJson(handler.Values); var message = handler.ToStringAndClear(); - Add(type, impact, message, json, players, entities); + Add(type, impact, message, json, players); } public override void Add(LogType type, ref LogStringHandler handler)