diff --git a/Content.Shared/Mind/SharedMindSystem.cs b/Content.Shared/Mind/SharedMindSystem.cs index 162bca495caf0a..8fc4655d15fd95 100644 --- a/Content.Shared/Mind/SharedMindSystem.cs +++ b/Content.Shared/Mind/SharedMindSystem.cs @@ -346,7 +346,7 @@ public bool TryAddObjective(EntityUid mindId, MindComponent mind, string proto) public void AddObjective(EntityUid mindId, MindComponent mind, EntityUid objective) { var title = Name(objective); - _adminLogger.Add(LogType.Mind, LogImpact.Low, $"Objective {objective} ({title}) added to mind of {MindOwnerLoggingString(mind)}"); + _adminLogger.Add(LogType.Mind, LogImpact.Low, $"Objective {objective} ({title}) added to mind of {mind.OwnedEntity} ({(mind.UserId == null ? "originally " : "")} {mind.UserId ?? mind.OriginalOwnerUserId})"); mind.Objectives.Add(objective); } @@ -362,7 +362,7 @@ public bool TryRemoveObjective(EntityUid mindId, MindComponent mind, int index) var objective = mind.Objectives[index]; var title = Name(objective); - _adminLogger.Add(LogType.Mind, LogImpact.Low, $"Objective {objective} ({title}) removed from the mind of {MindOwnerLoggingString(mind)}"); + _adminLogger.Add(LogType.Mind, LogImpact.Low, $"Objective {objective} ({title}) removed from the mind of {mind.OwnedEntity} ({(mind.UserId == null ? "originally " : "")} {mind.UserId ?? mind.OriginalOwnerUserId})"); mind.Objectives.Remove(objective); Del(objective); return true; @@ -526,7 +526,8 @@ public bool IsCharacterDeadIc(MindComponent mind) } /// - /// A string to represent the mind for logging + /// A string to represent the mind for logging. Note that this should not be used for admin logs, as the + /// entity information will get lost. /// public string MindOwnerLoggingString(MindComponent mind) { diff --git a/Content.Shared/Roles/SharedRoleSystem.cs b/Content.Shared/Roles/SharedRoleSystem.cs index 81a360ebb7f778..6cdab7c51b89e9 100644 --- a/Content.Shared/Roles/SharedRoleSystem.cs +++ b/Content.Shared/Roles/SharedRoleSystem.cs @@ -110,7 +110,7 @@ public void MindAddRoles(EntityUid mindId, ComponentRegistry components, MindCom } _adminLogger.Add(LogType.Mind, LogImpact.Low, - $"Role components {string.Join(components.Keys.ToString(), ", ")} added to mind of {_minds.MindOwnerLoggingString(mind)}"); + $"Role components {string.Join(components.Keys.ToString(), ", ")} added to mind of {mind.OwnedEntity} ({(mind.UserId == null ? "originally " : "")} {mind.UserId ?? mind.OriginalOwnerUserId})"); } public void MindAddRole(EntityUid mindId, Component component, MindComponent? mind = null, bool silent = false) @@ -136,7 +136,7 @@ public void MindAddRole(EntityUid mindId, Component component, MindComponent? mi } _adminLogger.Add(LogType.Mind, LogImpact.Low, - $"'Role {component}' added to mind of {_minds.MindOwnerLoggingString(mind)}"); + $"'Role {component}' added to mind of {mind.OwnedEntity} ({(mind.UserId == null ? "originally " : "")} {mind.UserId ?? mind.OriginalOwnerUserId})"); } /// @@ -173,7 +173,7 @@ public void MindAddRole(EntityUid mindId, Component component, MindComponent? mi } _adminLogger.Add(LogType.Mind, LogImpact.Low, - $"'Role {typeof(T).Name}' added to mind of {_minds.MindOwnerLoggingString(mind)}"); + $"'Role {typeof(T).Name}' added to mind of {mind.OwnedEntity} ({(mind.UserId == null ? "originally " : "")} {mind.UserId ?? mind.OriginalOwnerUserId})"); } /// @@ -200,7 +200,7 @@ public void MindRemoveRole(EntityUid mindId) where T : IComponent RaiseLocalEvent(mind.OwnedEntity.Value, message, true); } _adminLogger.Add(LogType.Mind, LogImpact.Low, - $"'Role {typeof(T).Name}' removed from mind of {_minds.MindOwnerLoggingString(mind)}"); + $"'Role {typeof(T).Name}' removed from mind of {mind.OwnedEntity} ({(mind.UserId == null ? "originally " : "")} {mind.UserId ?? mind.OriginalOwnerUserId})"); } public bool MindTryRemoveRole(EntityUid mindId) where T : IComponent