Inline Name

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 15:25:51 +01:00
parent 61be228ad0
commit ee4ff9cfe8
97 changed files with 237 additions and 177 deletions

View File

@@ -22,7 +22,7 @@ namespace Content.Client.Access.UI
{ {
base.Open(); base.Open();
_window = new IdCardConsoleWindow(this, _prototypeManager) {Title = Owner.Owner.Name}; _window = new IdCardConsoleWindow(this, _prototypeManager) {Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner.Uid).EntityName};
_window.OnClose += Close; _window.OnClose += Close;
_window.OpenCentered(); _window.OpenCentered();
} }

View File

@@ -47,7 +47,7 @@ namespace Content.Client.Administration.UI.ManageSolutions
_target = target; _target = target;
var targetName = _entityManager.TryGetEntity(target, out var entity) var targetName = _entityManager.TryGetEntity(target, out var entity)
? entity.Name ? IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName
: string.Empty; : string.Empty;
Title = Loc.GetString("admin-solutions-window-title", ("targetName", targetName)); Title = Loc.GetString("admin-solutions-window-title", ("targetName", targetName));

View File

@@ -15,11 +15,12 @@ namespace Content.Client.Animations
public static void AnimateEntityPickup(IEntity entity, EntityCoordinates initialPosition, Vector2 finalPosition) public static void AnimateEntityPickup(IEntity entity, EntityCoordinates initialPosition, Vector2 finalPosition)
{ {
var animatableClone = IoCManager.Resolve<IEntityManager>().SpawnEntity("clientsideclone", initialPosition); var animatableClone = IoCManager.Resolve<IEntityManager>().SpawnEntity("clientsideclone", initialPosition);
animatableClone.Name = entity.Name; string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName;
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(animatableClone.Uid).EntityName = val;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out SpriteComponent? sprite0)) if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out SpriteComponent? sprite0))
{ {
Logger.Error("Entity ({0}) couldn't be animated for pickup since it doesn't have a {1}!", entity.Name, nameof(SpriteComponent)); Logger.Error("Entity ({0}) couldn't be animated for pickup since it doesn't have a {1}!", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName, nameof(SpriteComponent));
return; return;
} }
var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(animatableClone.Uid); var sprite = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(animatableClone.Uid);

View File

@@ -147,7 +147,7 @@ namespace Content.Client.Body.UI
private void UpdateBodyPartBox(SharedBodyPartComponent part, string slotName) private void UpdateBodyPartBox(SharedBodyPartComponent part, string slotName)
{ {
BodyPartLabel.Text = $"{Loc.GetString(slotName)}: {Loc.GetString(part.Owner.Name)}"; BodyPartLabel.Text = $"{Loc.GetString(slotName)}: {Loc.GetString(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(part.Owner.Uid).EntityName)}";
// TODO BODY Part damage // TODO BODY Part damage
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(part.Owner.Uid, out DamageableComponent? damageable)) if (IoCManager.Resolve<IEntityManager>().TryGetComponent(part.Owner.Uid, out DamageableComponent? damageable))

View File

@@ -55,7 +55,7 @@ namespace Content.Client.CharacterInfo.Components
_control.SpriteView.Sprite = spriteComponent; _control.SpriteView.Sprite = spriteComponent;
} }
_control.NameLabel.Text = Owner.Name; _control.NameLabel.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName;
break; break;
} }
} }

View File

@@ -70,9 +70,9 @@ namespace Content.Client.ContextMenu.UI
EntityIcon.Sprite = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ISpriteComponent>(entity.Uid); EntityIcon.Sprite = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<ISpriteComponent>(entity.Uid);
if (UserInterfaceManager.DebugMonitors.Visible) if (UserInterfaceManager.DebugMonitors.Visible)
Text = $"{entity!.Name} ({entity.Uid})"; Text = $"{IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity!.Uid).EntityName} ({entity.Uid})";
else else
Text = entity!.Name; Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity!.Uid).EntityName;
} }
} }
} }

View File

@@ -250,7 +250,7 @@ namespace Content.Client.ContextMenu.UI
// find the element associated with this entity // find the element associated with this entity
if (!Elements.TryGetValue(entity, out var element)) if (!Elements.TryGetValue(entity, out var element))
{ {
Logger.Error($"Attempted to remove unknown entity from the entity menu: {entity.Name} ({entity.Uid})"); Logger.Error($"Attempted to remove unknown entity from the entity menu: {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} ({entity.Uid})");
return; return;
} }

View File

@@ -22,7 +22,7 @@ namespace Content.Client.ContextMenu.UI
{ {
if (GroupingContextMenuType == 0) if (GroupingContextMenuType == 0)
{ {
var newEntities = entities.GroupBy(e => e.Name + (IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(e.Uid).EntityPrototype?.ID ?? string.Empty)).ToList(); var newEntities = entities.GroupBy(e => IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(e.Uid).EntityName + (IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(e.Uid).EntityPrototype?.ID ?? string.Empty)).ToList();
return newEntities.Select(grp => grp.ToList()).ToList(); return newEntities.Select(grp => grp.ToList()).ToList();
} }
else else

View File

@@ -207,7 +207,7 @@ namespace Content.Client.DragDrop
} }
Logger.Warning("Unable to display drag shadow for {0} because it" + Logger.Warning("Unable to display drag shadow for {0} because it" +
" has no sprite component.", _dragDropHelper.Dragged.Name); " has no sprite component.", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_dragDropHelper.Dragged.Uid).EntityName);
return false; return false;
} }

View File

@@ -143,7 +143,7 @@ namespace Content.Client.Examine
hBox.AddChild(new Label hBox.AddChild(new Label
{ {
Text = entity.Name, Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName,
HorizontalExpand = true, HorizontalExpand = true,
}); });

View File

@@ -36,7 +36,7 @@ namespace Content.Client.Instruments.UI
if (_owner.Instrument != null) if (_owner.Instrument != null)
{ {
_owner.Instrument.OnMidiPlaybackEnded += InstrumentOnMidiPlaybackEnded; _owner.Instrument.OnMidiPlaybackEnded += InstrumentOnMidiPlaybackEnded;
Title = _owner.Instrument.Owner.Name; Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_owner.Instrument.Owner.Uid).EntityName;
LoopButton.Disabled = !_owner.Instrument.IsMidiOpen; LoopButton.Disabled = !_owner.Instrument.IsMidiOpen;
LoopButton.Pressed = _owner.Instrument.LoopMidi; LoopButton.Pressed = _owner.Instrument.LoopMidi;
StopButton.Disabled = !_owner.Instrument.IsMidiOpen; StopButton.Disabled = !_owner.Instrument.IsMidiOpen;

View File

@@ -4,6 +4,7 @@ using Content.Shared.Strip.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
using static Content.Shared.Inventory.EquipmentSlotDefines; using static Content.Shared.Inventory.EquipmentSlotDefines;
@@ -28,7 +29,7 @@ namespace Content.Client.Inventory
{ {
base.Open(); base.Open();
_strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", Owner.Owner.Name))}"); _strippingMenu = new StrippingMenu($"{Loc.GetString("strippable-bound-user-interface-stripping-menu-title",("ownerName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner.Uid).EntityName))}");
_strippingMenu.OnClose += Close; _strippingMenu.OnClose += Close;
_strippingMenu.OpenCentered(); _strippingMenu.OpenCentered();

View File

@@ -159,11 +159,11 @@ namespace Content.Client.Items.UI
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(_entity.Uid, out HandVirtualItemComponent? virtualItem) if (IoCManager.Resolve<IEntityManager>().TryGetComponent(_entity.Uid, out HandVirtualItemComponent? virtualItem)
&& _entityManager.TryGetEntity(virtualItem.BlockingEntity, out var blockEnt)) && _entityManager.TryGetEntity(virtualItem.BlockingEntity, out var blockEnt))
{ {
_itemNameLabel.Text = blockEnt.Name; _itemNameLabel.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(blockEnt.Uid).EntityName;
} }
else else
{ {
_itemNameLabel.Text = _entity.Name; _itemNameLabel.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_entity.Uid).EntityName;
} }
} }

View File

@@ -101,7 +101,7 @@ namespace Content.Client.Kitchen.UI
} }
var texture = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(entity.Uid).Icon?.Default; var texture = IoCManager.Resolve<IEntityManager>().GetComponent<SpriteComponent>(entity.Uid).Icon?.Default;
var solidItem = ChamberContentBox.BoxContents.AddItem(entity.Name, texture); var solidItem = ChamberContentBox.BoxContents.AddItem(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName, texture);
var solidIndex = ChamberContentBox.BoxContents.IndexOf(solidItem); var solidIndex = ChamberContentBox.BoxContents.IndexOf(solidItem);
_chamberVisualContents.Add(solidIndex, uid); _chamberVisualContents.Add(solidIndex, uid);
} }

View File

@@ -134,7 +134,7 @@ namespace Content.Client.Kitchen.UI
continue; continue;
} }
var solidItem = _menu.IngredientsList.AddItem(entity.Name, texture); var solidItem = _menu.IngredientsList.AddItem(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName, texture);
var solidIndex = _menu.IngredientsList.IndexOf(solidItem); var solidIndex = _menu.IngredientsList.IndexOf(solidItem);
_solids.Add(solidIndex, t); _solids.Add(solidIndex, t);
} }

View File

@@ -452,7 +452,7 @@ namespace Content.Client.Light.Components
} }
else else
{ {
Logger.Warning($"{Owner.Name} has a {nameof(LightBehaviourComponent)} but it has no {nameof(PointLightComponent)}! Check the prototype!"); Logger.Warning($"{IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName} has a {nameof(LightBehaviourComponent)} but it has no {nameof(PointLightComponent)}! Check the prototype!");
} }
} }

View File

@@ -1,6 +1,7 @@
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using static Content.Shared.MedicalScanner.SharedMedicalScannerComponent; using static Content.Shared.MedicalScanner.SharedMedicalScannerComponent;
namespace Content.Client.MedicalScanner.UI namespace Content.Client.MedicalScanner.UI
@@ -19,7 +20,7 @@ namespace Content.Client.MedicalScanner.UI
base.Open(); base.Open();
_window = new MedicalScannerWindow _window = new MedicalScannerWindow
{ {
Title = Owner.Owner.Name, Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner.Uid).EntityName,
}; };
_window.OnClose += Close; _window.OnClose += Close;
_window.ScanButton.OnPressed += _ => SendMessage(new UiButtonPressedMessage(UiButton.ScanDNA)); _window.ScanButton.OnPressed += _ => SendMessage(new UiButtonPressedMessage(UiButton.ScanDNA));

View File

@@ -37,7 +37,7 @@ namespace Content.Client.MedicalScanner.UI
} }
else else
{ {
text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", entity.Name))}\n"); text.Append($"{Loc.GetString("medical-scanner-window-entity-health-text", ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName))}\n");
var totalDamage = state.DamagePerType.Values.Sum(); var totalDamage = state.DamagePerType.Values.Sum();

View File

@@ -2,6 +2,7 @@ using JetBrains.Annotations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using static Content.Shared.Paper.SharedPaperComponent; using static Content.Shared.Paper.SharedPaperComponent;
namespace Content.Client.Paper.UI namespace Content.Client.Paper.UI
@@ -20,7 +21,7 @@ namespace Content.Client.Paper.UI
base.Open(); base.Open();
_window = new PaperWindow _window = new PaperWindow
{ {
Title = Owner.Owner.Name, Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner.Uid).EntityName,
}; };
_window.OnClose += Close; _window.OnClose += Close;
_window.Input.OnTextEntered += Input_OnTextEntered; _window.Input.OnTextEntered += Input_OnTextEntered;

View File

@@ -46,7 +46,7 @@ namespace Content.Client.Storage
{ {
base.OnAdd(); base.OnAdd();
_window = new StorageWindow(this) {Title = Owner.Name}; _window = new StorageWindow(this) {Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName};
_window.EntityList.GenerateItem += GenerateButton; _window.EntityList.GenerateItem += GenerateButton;
_window.EntityList.ItemPressed += Interact; _window.EntityList.ItemPressed += Interact;
} }
@@ -202,7 +202,7 @@ namespace Content.Client.Storage
{ {
HorizontalExpand = true, HorizontalExpand = true,
ClipText = true, ClipText = true,
Text = entity.Name Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName
}, },
new Label new Label
{ {

View File

@@ -30,7 +30,7 @@ namespace Content.Client.VendingMachines
VendingMachine = vendingMachine; VendingMachine = vendingMachine;
_menu = new VendingMachineMenu(this) {Title = Owner.Owner.Name}; _menu = new VendingMachineMenu(this) {Title = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Owner.Uid).EntityName};
_menu.Populate(VendingMachine.Inventory); _menu.Populate(VendingMachine.Inventory);
_menu.OnClose += Close; _menu.OnClose += Close;

View File

@@ -184,7 +184,7 @@ namespace Content.IntegrationTests.Tests.Body
await server.WaitRunTicks(increment); await server.WaitRunTicks(increment);
await server.WaitAssertion(() => await server.WaitAssertion(() =>
{ {
Assert.False(respirator.Suffocating, $"Entity {human.Name} is suffocating on tick {tick}"); Assert.False(respirator.Suffocating, $"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(human.Uid).EntityName} is suffocating on tick {tick}");
}); });
} }

View File

@@ -122,6 +122,7 @@ namespace Content.Server.Access.Components
// this could be prettier // this could be prettier
if (targetIdEntity == null) if (targetIdEntity == null)
{ {
IEntity? tempQualifier = PrivilegedIdSlot.Item;
newState = new IdCardConsoleBoundUserInterfaceState( newState = new IdCardConsoleBoundUserInterfaceState(
PrivilegedIdSlot.HasItem, PrivilegedIdSlot.HasItem,
PrivilegedIdIsAuthorized(), PrivilegedIdIsAuthorized(),
@@ -129,7 +130,7 @@ namespace Content.Server.Access.Components
null, null,
null, null,
null, null,
PrivilegedIdSlot.Item?.Name ?? string.Empty, (tempQualifier != null ? IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(tempQualifier.Uid).EntityName : null) ?? string.Empty,
string.Empty); string.Empty);
} }
else else
@@ -138,7 +139,7 @@ namespace Content.Server.Access.Components
var targetAccessComponent = IoCManager.Resolve<IEntityManager>().GetComponent<AccessComponent>(targetIdEntity.Uid); var targetAccessComponent = IoCManager.Resolve<IEntityManager>().GetComponent<AccessComponent>(targetIdEntity.Uid);
var name = string.Empty; var name = string.Empty;
if(PrivilegedIdSlot.Item != null) if(PrivilegedIdSlot.Item != null)
name = PrivilegedIdSlot.Item.Name; name = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(PrivilegedIdSlot.Item.Uid).EntityName;
newState = new IdCardConsoleBoundUserInterfaceState( newState = new IdCardConsoleBoundUserInterfaceState(
PrivilegedIdSlot.HasItem, PrivilegedIdSlot.HasItem,
PrivilegedIdIsAuthorized(), PrivilegedIdIsAuthorized(),
@@ -147,7 +148,7 @@ namespace Content.Server.Access.Components
targetIdComponent.JobTitle, targetIdComponent.JobTitle,
targetAccessComponent.Tags.ToArray(), targetAccessComponent.Tags.ToArray(),
name, name,
targetIdEntity.Name); IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(targetIdEntity.Uid).EntityName);
} }
UserInterface?.SetState(newState); UserInterface?.SetState(newState);
} }

View File

@@ -8,6 +8,7 @@ using Content.Shared.Inventory;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using Robust.Shared.IoC;
namespace Content.Server.Access.Systems namespace Content.Server.Access.Systems
{ {
@@ -21,7 +22,7 @@ namespace Content.Server.Access.Systems
private void OnInit(EntityUid uid, IdCardComponent id, ComponentInit args) private void OnInit(EntityUid uid, IdCardComponent id, ComponentInit args)
{ {
id.OriginalOwnerName ??= id.Owner.Name; id.OriginalOwnerName ??= IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(id.Owner.Uid).EntityName;
UpdateEntityName(uid, id); UpdateEntityName(uid, id);
} }
@@ -66,19 +67,20 @@ namespace Content.Server.Access.Systems
if (string.IsNullOrWhiteSpace(id.FullName) && string.IsNullOrWhiteSpace(id.JobTitle)) if (string.IsNullOrWhiteSpace(id.FullName) && string.IsNullOrWhiteSpace(id.JobTitle))
{ {
id.Owner.Name = id.OriginalOwnerName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(id.Owner.Uid).EntityName = id.OriginalOwnerName;
return; return;
} }
var jobSuffix = string.IsNullOrWhiteSpace(id.JobTitle) ? string.Empty : $" ({id.JobTitle})"; var jobSuffix = string.IsNullOrWhiteSpace(id.JobTitle) ? string.Empty : $" ({id.JobTitle})";
id.Owner.Name = string.IsNullOrWhiteSpace(id.FullName) var val = string.IsNullOrWhiteSpace(id.FullName)
? Loc.GetString("access-id-card-component-owner-name-job-title-text", ? Loc.GetString("access-id-card-component-owner-name-job-title-text",
("originalOwnerName", id.OriginalOwnerName), ("originalOwnerName", id.OriginalOwnerName),
("jobSuffix", jobSuffix)) ("jobSuffix", jobSuffix))
: Loc.GetString("access-id-card-component-owner-full-name-job-title-text", : Loc.GetString("access-id-card-component-owner-full-name-job-title-text",
("fullName", id.FullName), ("fullName", id.FullName),
("jobSuffix", jobSuffix)); ("jobSuffix", jobSuffix));
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(id.Owner.Uid).EntityName = val;
} }
/// <summary> /// <summary>

View File

@@ -1,6 +1,8 @@
using Content.Server.Popups; using Content.Server.Popups;
using Content.Shared.Actions.Behaviors; using Content.Shared.Actions.Behaviors;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Actions.Actions namespace Content.Server.Actions.Actions
@@ -11,14 +13,14 @@ namespace Content.Server.Actions.Actions
{ {
public void DoTargetEntityAction(TargetEntityItemActionEventArgs args) public void DoTargetEntityAction(TargetEntityItemActionEventArgs args)
{ {
args.Performer.PopupMessageEveryone(args.Item.Name + ": Clicked " + args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": Clicked " +
args.Target.Name); IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName);
} }
public void DoTargetEntityAction(TargetEntityActionEventArgs args) public void DoTargetEntityAction(TargetEntityActionEventArgs args)
{ {
args.Performer.PopupMessageEveryone("Clicked " + args.Performer.PopupMessageEveryone("Clicked " +
args.Target.Name); IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName);
} }
} }
} }

View File

@@ -1,6 +1,8 @@
using Content.Server.Popups; using Content.Server.Popups;
using Content.Shared.Actions.Behaviors; using Content.Shared.Actions.Behaviors;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Actions.Actions namespace Content.Server.Actions.Actions
@@ -11,7 +13,7 @@ namespace Content.Server.Actions.Actions
{ {
public void DoTargetPointAction(TargetPointItemActionEventArgs args) public void DoTargetPointAction(TargetPointItemActionEventArgs args)
{ {
args.Performer.PopupMessageEveryone(args.Item.Name + ": Clicked local position " + args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": Clicked local position " +
args.Target); args.Target);
} }

View File

@@ -2,6 +2,8 @@
using Content.Shared.Actions.Behaviors; using Content.Shared.Actions.Behaviors;
using Content.Shared.Actions.Behaviors.Item; using Content.Shared.Actions.Behaviors.Item;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Actions.Actions namespace Content.Server.Actions.Actions
@@ -17,11 +19,11 @@ namespace Content.Server.Actions.Actions
{ {
if (args.ToggledOn) if (args.ToggledOn)
{ {
args.Performer.PopupMessageEveryone(args.Item.Name + ": " + MessageOn); args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": " + MessageOn);
} }
else else
{ {
args.Performer.PopupMessageEveryone(args.Item.Name + ": " +MessageOff); args.Performer.PopupMessageEveryone(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Item.Uid).EntityName + ": " +MessageOff);
} }
return true; return true;

View File

@@ -84,10 +84,10 @@ namespace Content.Server.Actions.Actions
SoundSystem.Play(Filter.Pvs(args.Performer), PunchMissSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f)); SoundSystem.Play(Filter.Pvs(args.Performer), PunchMissSound.GetSound(), args.Performer, AudioHelpers.WithVariation(0.025f));
args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients", args.Performer.PopupMessageOtherClients(Loc.GetString("disarm-action-popup-message-other-clients",
("performerName", args.Performer.Name), ("performerName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Performer.Uid).EntityName),
("targetName", args.Target.Name))); ("targetName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName)));
args.Performer.PopupMessageCursor(Loc.GetString("disarm-action-popup-message-cursor", args.Performer.PopupMessageCursor(Loc.GetString("disarm-action-popup-message-cursor",
("targetName", args.Target.Name))); ("targetName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Target.Uid).EntityName)));
system.SendLunge(angle, args.Performer); system.SendLunge(angle, args.Performer);
return; return;
} }

View File

@@ -63,7 +63,7 @@ namespace Content.Server.Actions
if (!attempt.TryGetActionState(this, out var actionState) || !actionState.Enabled) if (!attempt.TryGetActionState(this, out var actionState) || !actionState.Enabled)
{ {
Logger.DebugS("action", "user {0} attempted to use" + Logger.DebugS("action", "user {0} attempted to use" +
" action {1} which is not granted to them", player.Name, " action {1} which is not granted to them", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName,
attempt); attempt);
return; return;
} }
@@ -71,7 +71,7 @@ namespace Content.Server.Actions
if (actionState.IsOnCooldown(GameTiming)) if (actionState.IsOnCooldown(GameTiming))
{ {
Logger.DebugS("action", "user {0} attempted to use" + Logger.DebugS("action", "user {0} attempted to use" +
" action {1} which is on cooldown", player.Name, " action {1} which is on cooldown", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName,
attempt); attempt);
return; return;
} }
@@ -86,7 +86,7 @@ namespace Content.Server.Actions
if (toggleMsg.ToggleOn == actionState.ToggledOn) if (toggleMsg.ToggleOn == actionState.ToggledOn)
{ {
Logger.DebugS("action", "user {0} attempted to" + Logger.DebugS("action", "user {0} attempted to" +
" toggle action {1} to {2}, but it is already toggled {2}", player.Name, " toggle action {1} to {2}, but it is already toggled {2}", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName,
attempt.Action.Name, toggleMsg.ToggleOn); attempt.Action.Name, toggleMsg.ToggleOn);
return; return;
} }
@@ -113,7 +113,7 @@ namespace Content.Server.Actions
{ {
Logger.DebugS("action", "user {0} attempted to" + Logger.DebugS("action", "user {0} attempted to" +
" perform target entity action {1} but could not find entity with " + " perform target entity action {1} but could not find entity with " +
"provided uid {2}", player.Name, attempt.Action.Name, "provided uid {2}", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName, attempt.Action.Name,
targetEntityMsg.Target); targetEntityMsg.Target);
return; return;
} }
@@ -204,7 +204,7 @@ namespace Content.Server.Actions
{ {
Logger.DebugS("action", "user {0} attempted to" + Logger.DebugS("action", "user {0} attempted to" +
" perform target action further than allowed range", " perform target action further than allowed range",
player.Name); IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName);
return false; return false;
} }

View File

@@ -126,7 +126,7 @@ namespace Content.Server.Administration
var username = string.Empty; var username = string.Empty;
if(session.AttachedEntity != null) if(session.AttachedEntity != null)
username = session.AttachedEntity.Name; username = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(session.AttachedEntity.Uid).EntityName;
var antag = session.ContentData()?.Mind?.AllRoles.Any(r => r.Antagonist) ?? false; var antag = session.ContentData()?.Mind?.AllRoles.Any(r => r.Antagonist) ?? false;
var uid = session.AttachedEntity?.Uid ?? EntityUid.Invalid; var uid = session.AttachedEntity?.Uid ?? EntityUid.Invalid;

View File

@@ -50,15 +50,15 @@ namespace Content.Server.Administration.Commands
{ {
// TODO: Remove duplication between all this and "GamePreset.OnGhostAttempt()"... // TODO: Remove duplication between all this and "GamePreset.OnGhostAttempt()"...
if(!string.IsNullOrWhiteSpace(mind.CharacterName)) if(!string.IsNullOrWhiteSpace(mind.CharacterName))
ghost.Name = mind.CharacterName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = mind.CharacterName;
else if (!string.IsNullOrWhiteSpace(mind.Session?.Name)) else if (!string.IsNullOrWhiteSpace(mind.Session?.Name))
ghost.Name = mind.Session.Name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = mind.Session.Name;
mind.Visit(ghost); mind.Visit(ghost);
} }
else else
{ {
ghost.Name = player.Name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = player.Name;
mind.TransferTo(ghost.Uid); mind.TransferTo(ghost.Uid);
} }

View File

@@ -69,7 +69,7 @@ namespace Content.Server.Administration.Commands
{ {
mind = new Mind.Mind(session.UserId) mind = new Mind.Mind(session.UserId)
{ {
CharacterName = target.Name CharacterName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName
}; };
mind.ChangeOwningPlayer(session.UserId); mind.ChangeOwningPlayer(session.UserId);
} }

View File

@@ -103,7 +103,7 @@ namespace Content.Server.Administration.Commands
IoCManager.Resolve<IEntityManager>().TryGetComponent<PDAComponent?>(equipmentEntity.Uid, out var pdaComponent) && IoCManager.Resolve<IEntityManager>().TryGetComponent<PDAComponent?>(equipmentEntity.Uid, out var pdaComponent) &&
pdaComponent.ContainedID != null) pdaComponent.ContainedID != null)
{ {
pdaComponent.ContainedID.FullName = target.Name; pdaComponent.ContainedID.FullName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName;
} }
inventoryComponent.Equip(slot, IoCManager.Resolve<IEntityManager>().GetComponent<ItemComponent>(equipmentEntity.Uid), false); inventoryComponent.Equip(slot, IoCManager.Resolve<IEntityManager>().GetComponent<ItemComponent>(equipmentEntity.Uid), false);

View File

@@ -1,5 +1,7 @@
using System.Text.Json; using System.Text.Json;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Administration.Logs.Converters; namespace Content.Server.Administration.Logs.Converters;
@@ -13,7 +15,7 @@ public class PlayerSessionConverter : AdminLogConverter<SerializablePlayer>
if (value.Player.AttachedEntity != null) if (value.Player.AttachedEntity != null)
{ {
writer.WriteNumber("id", (int) value.Player.AttachedEntity.Uid); writer.WriteNumber("id", (int) value.Player.AttachedEntity.Uid);
writer.WriteString("name", value.Player.AttachedEntity.Name); writer.WriteString("name", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(value.Player.AttachedEntity.Uid).EntityName);
} }
writer.WriteString("player", value.Player.UserId.UserId); writer.WriteString("player", value.Player.UserId.UserId);

View File

@@ -2,6 +2,7 @@
using Content.Server.Gravity.EntitySystems; using Content.Server.Gravity.EntitySystems;
using Content.Shared.Alert; using Content.Shared.Alert;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log; using Robust.Shared.Log;
using Robust.Shared.Network; using Robust.Shared.Network;
using Robust.Shared.Players; using Robust.Shared.Players;
@@ -66,7 +67,7 @@ namespace Content.Server.Alert
{ {
Logger.DebugS("alert", "user {0} attempted to" + Logger.DebugS("alert", "user {0} attempted to" +
" click alert {1} which is not currently showing for them", " click alert {1} which is not currently showing for them",
player.Name, msg.Type); IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName, msg.Type);
break; break;
} }

View File

@@ -668,7 +668,7 @@ namespace Content.Server.Arcade.Components
{ {
var blockGameSystem = EntitySystem.Get<BlockGameSystem>(); var blockGameSystem = EntitySystem.Get<BlockGameSystem>();
_highScorePlacement = blockGameSystem.RegisterHighScore(_component._player.AttachedEntity.Name, Points); _highScorePlacement = blockGameSystem.RegisterHighScore(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(_component._player.AttachedEntity.Uid).EntityName, Points);
SendHighscoreUpdate(); SendHighscoreUpdate();
} }
_component.UserInterface?.SendMessage(new BlockGameMessages.BlockGameGameOverScreenMessage(Points, _highScorePlacement?.LocalPlacement, _highScorePlacement?.GlobalPlacement)); _component.UserInterface?.SendMessage(new BlockGameMessages.BlockGameGameOverScreenMessage(Points, _highScorePlacement?.LocalPlacement, _highScorePlacement?.GlobalPlacement));

View File

@@ -70,7 +70,7 @@ namespace Content.Server.Atmos.Components
}; };
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription = val; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription = val;
Owner.Name = _type switch var val1 = _type switch
{ {
PlaqueType.Zumos => PlaqueType.Zumos =>
"ZUM Atmospherics Division plaque", "ZUM Atmospherics Division plaque",
@@ -83,6 +83,7 @@ namespace Content.Server.Atmos.Components
PlaqueType.Unset => "Uhm", PlaqueType.Unset => "Uhm",
_ => "Uhm", _ => "Uhm",
}; };
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName = val1;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out AppearanceComponent? appearance)) if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner.Uid, out AppearanceComponent? appearance))
{ {

View File

@@ -127,7 +127,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
return; return;
_userInterfaceSystem.TrySetUiState(uid, GasPressurePumpUiKey.Key, _userInterfaceSystem.TrySetUiState(uid, GasPressurePumpUiKey.Key,
new GasPressurePumpBoundUserInterfaceState(pump.Owner.Name, pump.TargetPressure, pump.Enabled)); new GasPressurePumpBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pump.Owner.Uid).EntityName, pump.TargetPressure, pump.Enabled));
} }
} }
} }

View File

@@ -132,7 +132,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
return; return;
_userInterfaceSystem.TrySetUiState(uid, GasVolumePumpUiKey.Key, _userInterfaceSystem.TrySetUiState(uid, GasVolumePumpUiKey.Key,
new GasVolumePumpBoundUserInterfaceState(pump.Owner.Name, pump.TransferRate, pump.Enabled)); new GasVolumePumpBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pump.Owner.Uid).EntityName, pump.TransferRate, pump.Enabled));
} }
} }
} }

View File

@@ -104,7 +104,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
return; return;
_userInterfaceSystem.TrySetUiState(uid, GasFilterUiKey.Key, _userInterfaceSystem.TrySetUiState(uid, GasFilterUiKey.Key,
new GasFilterBoundUserInterfaceState(filter.Owner.Name, filter.TransferRate, filter.Enabled, filter.FilteredGas)); new GasFilterBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(filter.Owner.Uid).EntityName, filter.TransferRate, filter.Enabled, filter.FilteredGas));
} }
private void OnToggleStatusMessage(EntityUid uid, GasFilterComponent filter, GasFilterToggleStatusMessage args) private void OnToggleStatusMessage(EntityUid uid, GasFilterComponent filter, GasFilterToggleStatusMessage args)

View File

@@ -128,7 +128,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
return; return;
_userInterfaceSystem.TrySetUiState(uid, GasMixerUiKey.Key, _userInterfaceSystem.TrySetUiState(uid, GasMixerUiKey.Key,
new GasMixerBoundUserInterfaceState(mixer.Owner.Name, mixer.TargetPressure, mixer.Enabled, mixer.InletOneConcentration)); new GasMixerBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mixer.Owner.Uid).EntityName, mixer.TargetPressure, mixer.Enabled, mixer.InletOneConcentration));
} }
private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args) private void OnToggleStatusMessage(EntityUid uid, GasMixerComponent mixer, GasMixerToggleStatusMessage args)

View File

@@ -117,7 +117,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems
} }
_userInterfaceSystem.TrySetUiState(uid, GasCanisterUiKey.Key, _userInterfaceSystem.TrySetUiState(uid, GasCanisterUiKey.Key,
new GasCanisterBoundUserInterfaceState(canister.Owner.Name, new GasCanisterBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(canister.Owner.Uid).EntityName,
canister.Air.Pressure, portStatus, tankLabel, tankPressure, canister.ReleasePressure, canister.Air.Pressure, portStatus, tankLabel, tankPressure, canister.ReleasePressure,
canister.ReleaseValve, canister.MinReleasePressure, canister.MaxReleasePressure)); canister.ReleaseValve, canister.MinReleasePressure, canister.MaxReleasePressure));
} }

View File

@@ -83,11 +83,12 @@ namespace Content.Server.BarSign.Systems
if (!string.IsNullOrEmpty(prototype.Name)) if (!string.IsNullOrEmpty(prototype.Name))
{ {
component.Owner.Name = prototype.Name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityName = prototype.Name;
} }
else else
{ {
component.Owner.Name = Loc.GetString("barsign-component-name"); string val = Loc.GetString("barsign-component-name");
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityName = val;
} }
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityDescription = prototype.Description; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityDescription = prototype.Description;

View File

@@ -75,7 +75,7 @@ namespace Content.Server.Body.Commands
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out SharedBodyComponent? body)) if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out SharedBodyComponent? body))
{ {
shell.WriteLine($"Entity {entity.Name} with uid {entity.Uid} does not have a {nameof(SharedBodyComponent)} component."); shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} with uid {entity.Uid} does not have a {nameof(SharedBodyComponent)} component.");
return; return;
} }
@@ -87,13 +87,13 @@ namespace Content.Server.Body.Commands
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(partEntity.Uid, out SharedBodyPartComponent? part)) if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(partEntity.Uid, out SharedBodyPartComponent? part))
{ {
shell.WriteLine($"Entity {partEntity.Name} with uid {args[0]} does not have a {nameof(SharedBodyPartComponent)} component."); shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(partEntity.Uid).EntityName} with uid {args[0]} does not have a {nameof(SharedBodyPartComponent)} component.");
return; return;
} }
if (body.HasPart(part)) if (body.HasPart(part))
{ {
shell.WriteLine($"Body part {partEntity.Name} with uid {partEntity.Uid} is already attached to entity {entity.Name} with uid {entity.Uid}"); shell.WriteLine($"Body part {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(partEntity.Uid).EntityName} with uid {partEntity.Uid} is already attached to entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} with uid {entity.Uid}");
return; return;
} }

View File

@@ -87,7 +87,7 @@ namespace Content.Server.Body.Components
else // If surgery cannot be performed, show message saying so. else // If surgery cannot be performed, show message saying so.
{ {
eventArgs.Target?.PopupMessage(eventArgs.User, eventArgs.Target?.PopupMessage(eventArgs.User,
Loc.GetString("mechanism-component-no-way-to-install-message", ("partName", Owner.Name))); Loc.GetString("mechanism-component-no-way-to-install-message", ("partName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName)));
} }
} }
@@ -113,7 +113,7 @@ namespace Content.Server.Body.Components
if (!OptionsCache.TryGetValue(key, out var targetObject)) if (!OptionsCache.TryGetValue(key, out var targetObject))
{ {
BodyCache.Owner.PopupMessage(PerformerCache, BodyCache.Owner.PopupMessage(PerformerCache,
Loc.GetString("mechanism-component-no-useful-way-to-use-message",("partName", Owner.Name))); Loc.GetString("mechanism-component-no-useful-way-to-use-message",("partName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName)));
return; return;
} }

View File

@@ -109,7 +109,7 @@ namespace Content.Server.Body.Surgery.Components
} }
// Log error if the surgery fails somehow. // Log error if the surgery fails somehow.
Logger.Debug($"Error when trying to perform surgery on ${nameof(SharedBodyPartComponent)} {eventArgs.User.Name}"); Logger.Debug($"Error when trying to perform surgery on ${nameof(SharedBodyPartComponent)} {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(eventArgs.User.Uid).EntityName}");
throw new InvalidOperationException(); throw new InvalidOperationException();
} }

View File

@@ -684,7 +684,7 @@ namespace Content.Server.Botany.Components
} }
user.PopupMessageCursor(Loc.GetString("plant-holder-component-already-seeded-message", user.PopupMessageCursor(Loc.GetString("plant-holder-component-already-seeded-message",
("name", Owner.Name))); ("name", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName)));
return false; return false;
} }
@@ -693,9 +693,9 @@ namespace Content.Server.Botany.Components
if (WeedLevel > 0) if (WeedLevel > 0)
{ {
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-weeds-message", user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-weeds-message",
("name", Owner.Name))); ("name", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName)));
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-weeds-others-message", user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-weeds-others-message",
("otherName", user.Name))); ("otherName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(user.Uid).EntityName)));
WeedLevel = 0; WeedLevel = 0;
UpdateSprite(); UpdateSprite();
} }
@@ -712,9 +712,9 @@ namespace Content.Server.Botany.Components
if (Seed != null) if (Seed != null)
{ {
user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-plant-message", user.PopupMessageCursor(Loc.GetString("plant-holder-component-remove-plant-message",
("name", Owner.Name))); ("name", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName)));
user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-plant-others-message", user.PopupMessageOtherClients(Loc.GetString("plant-holder-component-remove-plant-others-message",
("name", user.Name))); ("name", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(user.Uid).EntityName)));
RemovePlant(); RemovePlant();
} }
else else

View File

@@ -29,7 +29,7 @@ namespace Content.Server.Botany.Components
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(eventArgs.Using.Uid, out ProduceComponent? produce) && produce.Seed != null) if (IoCManager.Resolve<IEntityManager>().TryGetComponent(eventArgs.Using.Uid, out ProduceComponent? produce) && produce.Seed != null)
{ {
eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", eventArgs.Using.Name))); eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(eventArgs.Using.Uid).EntityName)));
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(eventArgs.Using.Uid); IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(eventArgs.Using.Uid);

View File

@@ -263,7 +263,8 @@ namespace Content.Server.Botany
sprite.LayerSetSprite(0, new SpriteSpecifier.Rsi(PlantRsi, "seed")); sprite.LayerSetSprite(0, new SpriteSpecifier.Rsi(PlantRsi, "seed"));
} }
seed.Name = Loc.GetString("botany-seed-packet-name", ("seedName", SeedName), ("seedNoun", SeedNoun)); string val = Loc.GetString("botany-seed-packet-name", ("seedName", SeedName), ("seedNoun", SeedNoun));
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(seed.Uid).EntityName = val;
return seed; return seed;
} }
@@ -341,7 +342,8 @@ namespace Content.Server.Botany
if (Mysterious) if (Mysterious)
{ {
entity.Name += "?"; string val1 = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName + "?";
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName = val1;
string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription + (" " + Loc.GetString("botany-mysterious-description-addon")); string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription + (" " + Loc.GetString("botany-mysterious-description-addon"));
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription = val; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityDescription = val;
} }

View File

@@ -50,7 +50,7 @@ namespace Content.Server.Buckle.Systems
if (entity == args.User) if (entity == args.User)
verb.Text = Loc.GetString("verb-self-target-pronoun"); verb.Text = Loc.GetString("verb-self-target-pronoun");
else else
verb.Text = entity.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName;
// In the event that you have more than once entity with the same name strapped to the same object, // In the event that you have more than once entity with the same name strapped to the same object,
// these two verbs will be identical according to Verb.CompareTo, and only one with actually be added to // these two verbs will be identical according to Verb.CompareTo, and only one with actually be added to
@@ -88,7 +88,7 @@ namespace Content.Server.Buckle.Systems
Verb verb = new(); Verb verb = new();
verb.Act = () => usingBuckle.TryBuckle(args.User, args.Target); verb.Act = () => usingBuckle.TryBuckle(args.User, args.Target);
verb.Category = VerbCategory.Buckle; verb.Category = VerbCategory.Buckle;
verb.Text = args.Using.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Uid).EntityName;
// If the used entity is a person being pulled, prioritize this verb. Conversely, if it is // If the used entity is a person being pulled, prioritize this verb. Conversely, if it is
// just a held object, the user is probably just trying to sit down. // just a held object, the user is probably just trying to sit down.

View File

@@ -129,7 +129,8 @@ namespace Content.Server.Cargo.Components
return; return;
// fill in the order data // fill in the order data
printed.Name = Loc.GetString("cargo-console-paper-print-name", ("orderNumber", data.OrderNumber)); string val = Loc.GetString("cargo-console-paper-print-name", ("orderNumber", data.OrderNumber));
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(printed.Uid).EntityName = val;
paper.SetContent(Loc.GetString( paper.SetContent(Loc.GetString(
"cargo-console-paper-print-text", "cargo-console-paper-print-text",
("orderNumber", data.OrderNumber), ("orderNumber", data.OrderNumber),

View File

@@ -194,7 +194,7 @@ namespace Content.Server.Chat.Managers
var msg = _netManager.CreateNetMessage<MsgChatMessage>(); var msg = _netManager.CreateNetMessage<MsgChatMessage>();
msg.Channel = ChatChannel.Local; msg.Channel = ChatChannel.Local;
msg.Message = message; msg.Message = message;
msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", source.Name)); msg.MessageWrap = Loc.GetString("chat-manager-entity-say-wrap-message",("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(source.Uid).EntityName));
msg.SenderEntity = source.Uid; msg.SenderEntity = source.Uid;
msg.HideChat = hideChat; msg.HideChat = hideChat;
_netManager.ServerSendToMany(msg, clients); _netManager.ServerSendToMany(msg, clients);
@@ -231,7 +231,7 @@ namespace Content.Server.Chat.Managers
var msg = _netManager.CreateNetMessage<MsgChatMessage>(); var msg = _netManager.CreateNetMessage<MsgChatMessage>();
msg.Channel = ChatChannel.Emotes; msg.Channel = ChatChannel.Emotes;
msg.Message = action; msg.Message = action;
msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName",source.Name)); msg.MessageWrap = Loc.GetString("chat-manager-entity-me-wrap-message", ("entityName",Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(source.Uid).EntityName));
msg.SenderEntity = source.Uid; msg.SenderEntity = source.Uid;
_netManager.ServerSendToMany(msg, clients); _netManager.ServerSendToMany(msg, clients);
} }
@@ -296,9 +296,10 @@ namespace Content.Server.Chat.Managers
var msg = _netManager.CreateNetMessage<MsgChatMessage>(); var msg = _netManager.CreateNetMessage<MsgChatMessage>();
msg.Channel = ChatChannel.Dead; msg.Channel = ChatChannel.Dead;
msg.Message = message; msg.Message = message;
IEntity? tempQualifier = player.AttachedEntity;
msg.MessageWrap = Loc.GetString("chat-manager-send-dead-chat-wrap-message", msg.MessageWrap = Loc.GetString("chat-manager-send-dead-chat-wrap-message",
("deadChannelName", Loc.GetString("chat-manager-dead-channel-name")), ("deadChannelName", Loc.GetString("chat-manager-dead-channel-name")),
("playerName", player.AttachedEntity?.Name ?? "???")); ("playerName", (tempQualifier != null ? IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(tempQualifier.Uid).EntityName : null) ?? "???"));
msg.SenderEntity = player.AttachedEntityUid.GetValueOrDefault(); msg.SenderEntity = player.AttachedEntityUid.GetValueOrDefault();
_netManager.ServerSendToMany(msg, clients.ToList()); _netManager.ServerSendToMany(msg, clients.ToList());
} }

View File

@@ -187,13 +187,13 @@ namespace Content.Server.Chemistry.Components
!EntitySystem.Get<SolutionContainerSystem>().TryGetSolution(beaker.Uid, fits.Solution, out var beakerSolution)) !EntitySystem.Get<SolutionContainerSystem>().TryGetSolution(beaker.Uid, fits.Solution, out var beakerSolution))
{ {
return new ChemMasterBoundUserInterfaceState(Powered, false, FixedPoint2.New(0), FixedPoint2.New(0), return new ChemMasterBoundUserInterfaceState(Powered, false, FixedPoint2.New(0), FixedPoint2.New(0),
"", _label, Owner.Name, new List<Solution.ReagentQuantity>(), BufferSolution.Contents, _bufferModeTransfer, "", _label, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, new List<Solution.ReagentQuantity>(), BufferSolution.Contents, _bufferModeTransfer,
BufferSolution.TotalVolume, _pillType); BufferSolution.TotalVolume, _pillType);
} }
return new ChemMasterBoundUserInterfaceState(Powered, true, beakerSolution.CurrentVolume, return new ChemMasterBoundUserInterfaceState(Powered, true, beakerSolution.CurrentVolume,
beakerSolution.MaxVolume, beakerSolution.MaxVolume,
beaker.Name, _label, Owner.Name, beakerSolution.Contents, BufferSolution.Contents, _bufferModeTransfer, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(beaker.Uid).EntityName, _label, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, beakerSolution.Contents, BufferSolution.Contents, _bufferModeTransfer,
BufferSolution.TotalVolume, _pillType); BufferSolution.TotalVolume, _pillType);
} }
@@ -306,8 +306,9 @@ namespace Content.Server.Chemistry.Components
//Adding label //Adding label
LabelComponent labelComponent = bottle.EnsureComponent<LabelComponent>(); LabelComponent labelComponent = bottle.EnsureComponent<LabelComponent>();
labelComponent.OriginalName = bottle.Name; labelComponent.OriginalName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(bottle.Uid).EntityName;
bottle.Name += $" ({label})"; string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(bottle.Uid).EntityName + $" ({label})";
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(bottle.Uid).EntityName = val;
labelComponent.CurrentLabel = label; labelComponent.CurrentLabel = label;
var bufferSolution = BufferSolution.SplitSolution(actualVolume); var bufferSolution = BufferSolution.SplitSolution(actualVolume);
@@ -348,8 +349,9 @@ namespace Content.Server.Chemistry.Components
//Adding label //Adding label
LabelComponent labelComponent = pill.EnsureComponent<LabelComponent>(); LabelComponent labelComponent = pill.EnsureComponent<LabelComponent>();
labelComponent.OriginalName = pill.Name; labelComponent.OriginalName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pill.Uid).EntityName;
pill.Name += $" ({label})"; string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pill.Uid).EntityName + $" ({label})";
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(pill.Uid).EntityName = val;
labelComponent.CurrentLabel = label; labelComponent.CurrentLabel = label;
var bufferSolution = BufferSolution.SplitSolution(actualVolume); var bufferSolution = BufferSolution.SplitSolution(actualVolume);

View File

@@ -230,12 +230,12 @@ namespace Content.Server.Chemistry.Components
{ {
return new ReagentDispenserBoundUserInterfaceState(Powered, false, FixedPoint2.New(0), return new ReagentDispenserBoundUserInterfaceState(Powered, false, FixedPoint2.New(0),
FixedPoint2.New(0), FixedPoint2.New(0),
string.Empty, Inventory, Owner.Name, null, _dispenseAmount); string.Empty, Inventory, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, null, _dispenseAmount);
} }
return new ReagentDispenserBoundUserInterfaceState(Powered, true, solution.CurrentVolume, return new ReagentDispenserBoundUserInterfaceState(Powered, true, solution.CurrentVolume,
solution.MaxVolume, solution.MaxVolume,
beaker.Name, Inventory, Owner.Name, solution.Contents.ToList(), _dispenseAmount); IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(beaker.Uid).EntityName, Inventory, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName, solution.Contents.ToList(), _dispenseAmount);
} }
public void UpdateUserInterface() public void UpdateUserInterface()

View File

@@ -29,7 +29,7 @@ namespace Content.Server.Chemistry.Components
InitialSprite = new SpriteSpecifier.Rsi(new ResourcePath(sprite.BaseRSIPath), "icon"); InitialSprite = new SpriteSpecifier.Rsi(new ResourcePath(sprite.BaseRSIPath), "icon");
} }
InitialName = Owner.Name; InitialName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName;
InitialDescription = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription; InitialDescription = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription;
} }

View File

@@ -56,7 +56,8 @@ namespace Content.Server.Chemistry.EntitySystems
sprite?.LayerSetSprite(0, spriteSpec); sprite?.LayerSetSprite(0, spriteSpec);
} }
ownerEntity.Name = proto.Name + " glass"; string val = proto.Name + " glass";
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ownerEntity.Uid).EntityName = val;
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ownerEntity.Uid).EntityDescription = proto.Description; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ownerEntity.Uid).EntityDescription = proto.Description;
component.CurrentReagent = proto; component.CurrentReagent = proto;
component.Transformed = true; component.Transformed = true;
@@ -74,7 +75,7 @@ namespace Content.Server.Chemistry.EntitySystems
sprite.LayerSetSprite(0, component.InitialSprite); sprite.LayerSetSprite(0, component.InitialSprite);
} }
component.Owner.Name = component.InitialName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityName = component.InitialName;
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityDescription = component.InitialDescription; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityDescription = component.InitialDescription;
} }
} }

View File

@@ -36,7 +36,7 @@ namespace Content.Server.Climbing.Components
if (!Owner.EnsureComponent(out PhysicsComponent _)) if (!Owner.EnsureComponent(out PhysicsComponent _))
{ {
Logger.Warning($"Entity {Owner.Name} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).MapPosition} didn't have a {nameof(PhysicsComponent)}"); Logger.Warning($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName} at {IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).MapPosition} didn't have a {nameof(PhysicsComponent)}");
} }
} }

View File

@@ -139,7 +139,7 @@ namespace Content.Server.Cloning.Components
EntitySystem.Get<SharedHumanoidAppearanceSystem>().UpdateFromProfile(mob.Uid, dna.Profile); EntitySystem.Get<SharedHumanoidAppearanceSystem>().UpdateFromProfile(mob.Uid, dna.Profile);
mob.Name = dna.Profile.Name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mob.Uid).EntityName = dna.Profile.Name;
var cloneMindReturn = IoCManager.Resolve<IEntityManager>().AddComponent<BeingClonedComponent>(mob); var cloneMindReturn = IoCManager.Resolve<IEntityManager>().AddComponent<BeingClonedComponent>(mob);
cloneMindReturn.Mind = mind; cloneMindReturn.Mind = mind;

View File

@@ -65,7 +65,7 @@ namespace Content.Server.Commands
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(ent.Uid).LocalPosition.X.ToString(CultureInfo.InvariantCulture)); IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(ent.Uid).LocalPosition.X.ToString(CultureInfo.InvariantCulture));
ruleString = ruleString.Replace("$LY", ruleString = ruleString.Replace("$LY",
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(ent.Uid).LocalPosition.Y.ToString(CultureInfo.InvariantCulture)); IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(ent.Uid).LocalPosition.Y.ToString(CultureInfo.InvariantCulture));
ruleString = ruleString.Replace("$NAME", ent.Name); ruleString = ruleString.Replace("$NAME", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ent.Uid).EntityName);
if (shell.Player is IPlayerSession player) if (shell.Player is IPlayerSession player)
{ {

View File

@@ -36,9 +36,9 @@ namespace Content.Server.Construction.Conditions
if (airlock.BoltsDown != Value) if (airlock.BoltsDown != Value)
{ {
if (Value == true) if (Value == true)
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", entity.Name)) + "\n"); args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-bolt", ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName)) + "\n");
else else
args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", entity.Name)) + "\n"); args.PushMarkup(Loc.GetString("construction-examine-condition-airlock-unbolt", ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName)) + "\n");
return true; return true;
} }

View File

@@ -34,9 +34,9 @@ namespace Content.Server.Construction.Conditions
if (door.IsWeldedShut != Welded) if (door.IsWeldedShut != Welded)
{ {
if (Welded == true) if (Welded == true)
args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", entity.Name)) + "\n"); args.PushMarkup(Loc.GetString("construction-examine-condition-door-weld", ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName)) + "\n");
else else
args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", entity.Name)) + "\n"); args.PushMarkup(Loc.GetString("construction-examine-condition-door-unweld", ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName)) + "\n");
return true; return true;
} }

View File

@@ -267,7 +267,7 @@ namespace Content.Server.Cuffs.Components
{ {
cuff.Broken = true; cuff.Broken = true;
cuffsToRemove.Name = cuff.BrokenName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(cuffsToRemove.Uid).EntityName = cuff.BrokenName;
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(cuffsToRemove.Uid).EntityDescription = cuff.BrokenDesc; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(cuffsToRemove.Uid).EntityDescription = cuff.BrokenDesc;
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SpriteComponent?>(cuffsToRemove.Uid, out var sprite) && cuff.BrokenState != null) if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SpriteComponent?>(cuffsToRemove.Uid, out var sprite) && cuff.BrokenState != null)

View File

@@ -106,7 +106,7 @@ namespace Content.Server.Damage.Commands
var damage = new DamageSpecifier(damageGroup, amount); var damage = new DamageSpecifier(damageGroup, amount);
EntitySystem.Get<DamageableSystem>().TryChangeDamage(entity.Uid, damage, ignoreResistances); EntitySystem.Get<DamageableSystem>().TryChangeDamage(entity.Uid, damage, ignoreResistances);
shell.WriteLine($"Damaged entity {entity.Name} with id {entity.Uid} for {amount} {damageGroup} damage{(ignoreResistances ? ", ignoring resistances." : ".")}"); shell.WriteLine($"Damaged entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} with id {entity.Uid} for {amount} {damageGroup} damage{(ignoreResistances ? ", ignoring resistances." : ".")}");
}; };
return true; return true;
@@ -119,7 +119,7 @@ namespace Content.Server.Damage.Commands
var damage = new DamageSpecifier(damageType, amount); var damage = new DamageSpecifier(damageType, amount);
EntitySystem.Get<DamageableSystem>().TryChangeDamage(entity.Uid, damage, ignoreResistances); EntitySystem.Get<DamageableSystem>().TryChangeDamage(entity.Uid, damage, ignoreResistances);
shell.WriteLine($"Damaged entity {entity.Name} with id {entity.Uid} for {amount} {damageType} damage{(ignoreResistances ? ", ignoring resistances." : ".")}"); shell.WriteLine($"Damaged entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} with id {entity.Uid} for {amount} {damageType} damage{(ignoreResistances ? ", ignoring resistances." : ".")}");
}; };
return true; return true;
@@ -199,7 +199,7 @@ namespace Content.Server.Damage.Commands
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out DamageableComponent? damageable)) if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(entity.Uid, out DamageableComponent? damageable))
{ {
shell.WriteLine($"Entity {entity.Name} with id {entity.Uid} does not have a {nameof(DamageableComponent)}."); shell.WriteLine($"Entity {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName} with id {entity.Uid} does not have a {nameof(DamageableComponent)}.");
return; return;
} }

View File

@@ -483,7 +483,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
public void UpdateInterface(DisposalUnitComponent component, bool powered) public void UpdateInterface(DisposalUnitComponent component, bool powered)
{ {
var stateString = Loc.GetString($"{component.State}"); var stateString = Loc.GetString($"{component.State}");
var state = new SharedDisposalUnitComponent.DisposalUnitBoundUserInterfaceState(component.Owner.Name, stateString, EstimatedFullPressure(component), powered, component.Engaged); var state = new SharedDisposalUnitComponent.DisposalUnitBoundUserInterfaceState(IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityName, stateString, EstimatedFullPressure(component), powered, component.Engaged);
component.UserInterface?.SetState(state); component.UserInterface?.SetState(state);
} }

View File

@@ -220,7 +220,7 @@ namespace Content.Server.Doors.Components
{ {
if (!CanWeldShut) if (!CanWeldShut)
{ {
Logger.Warning("{0} prototype loaded with incompatible flags: 'welded' is true, but door cannot be welded.", Owner.Name); Logger.Warning("{0} prototype loaded with incompatible flags: 'welded' is true, but door cannot be welded.", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName);
return; return;
} }
SetAppearance(DoorVisualState.Welded); SetAppearance(DoorVisualState.Welded);
@@ -243,7 +243,7 @@ namespace Content.Server.Doors.Components
{ {
if (IsWeldedShut) if (IsWeldedShut)
{ {
Logger.Warning("{0} prototype loaded with incompatible flags: 'welded' and 'startOpen' are both true.", Owner.Name); Logger.Warning("{0} prototype loaded with incompatible flags: 'welded' and 'startOpen' are both true.", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName);
return; return;
} }
QuickOpen(false); QuickOpen(false);

View File

@@ -274,13 +274,21 @@ namespace Content.Server.GameTicking
} }
// Finish // Finish
var antag = mind.AllRoles.Any(role => role.Antagonist); var antag = mind.AllRoles.Any(role => role.Antagonist);
var playerIcName = string.Empty;
if (mind.CharacterName != null)
playerIcName = mind.CharacterName;
else if (mind.CurrentEntity != null)
playerIcName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mind.CurrentEntity.Uid).EntityName;
var playerEndRoundInfo = new RoundEndMessageEvent.RoundEndPlayerInfo() var playerEndRoundInfo = new RoundEndMessageEvent.RoundEndPlayerInfo()
{ {
// Note that contentPlayerData?.Name sticks around after the player is disconnected. // Note that contentPlayerData?.Name sticks around after the player is disconnected.
// This is as opposed to ply?.Name which doesn't. // This is as opposed to ply?.Name which doesn't.
PlayerOOCName = contentPlayerData?.Name ?? "(IMPOSSIBLE: REGISTERED MIND WITH NO OWNER)", PlayerOOCName = contentPlayerData?.Name ?? "(IMPOSSIBLE: REGISTERED MIND WITH NO OWNER)",
// Character name takes precedence over current entity name // Character name takes precedence over current entity name
PlayerICName = mind.CharacterName ?? mind.CurrentEntity?.Name, PlayerICName = playerIcName,
Role = antag Role = antag
? mind.AllRoles.First(role => role.Antagonist).Name ? mind.AllRoles.First(role => role.Antagonist).Name
: mind.AllRoles.FirstOrDefault()?.Name ?? Loc.GetString("game-ticker-unknown-role"), : mind.AllRoles.FirstOrDefault()?.Name ?? Loc.GetString("game-ticker-unknown-role"),

View File

@@ -190,7 +190,7 @@ namespace Content.Server.GameTicking
newMind.AddRole(new ObserverRole(newMind)); newMind.AddRole(new ObserverRole(newMind));
var mob = SpawnObserverMob(); var mob = SpawnObserverMob();
mob.Name = name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mob.Uid).EntityName = name;
var ghost = IoCManager.Resolve<IEntityManager>().GetComponent<GhostComponent>(mob.Uid); var ghost = IoCManager.Resolve<IEntityManager>().GetComponent<GhostComponent>(mob.Uid);
EntitySystem.Get<SharedGhostSystem>().SetCanReturnToBody(ghost, false); EntitySystem.Get<SharedGhostSystem>().SetCanReturnToBody(ghost, false);
newMind.TransferTo(mob.Uid); newMind.TransferTo(mob.Uid);
@@ -214,7 +214,7 @@ namespace Content.Server.GameTicking
if (profile != null) if (profile != null)
{ {
EntitySystem.Get<SharedHumanoidAppearanceSystem>().UpdateFromProfile(entity.Uid, profile); EntitySystem.Get<SharedHumanoidAppearanceSystem>().UpdateFromProfile(entity.Uid, profile);
entity.Name = profile.Name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity.Uid).EntityName = profile.Name;
} }
return entity; return entity;

View File

@@ -78,9 +78,9 @@ namespace Content.Server.GameTicking.Presets
// If all else fails, it'll default to the default entity prototype name, "observer". // If all else fails, it'll default to the default entity prototype name, "observer".
// However, that should rarely happen. // However, that should rarely happen.
if(!string.IsNullOrWhiteSpace(mind.CharacterName)) if(!string.IsNullOrWhiteSpace(mind.CharacterName))
ghost.Name = mind.CharacterName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = mind.CharacterName;
else if (!string.IsNullOrWhiteSpace(mind.Session?.Name)) else if (!string.IsNullOrWhiteSpace(mind.Session?.Name))
ghost.Name = mind.Session.Name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = mind.Session.Name;
var ghostComponent = IoCManager.Resolve<IEntityManager>().GetComponent<GhostComponent>(ghost.Uid); var ghostComponent = IoCManager.Resolve<IEntityManager>().GetComponent<GhostComponent>(ghost.Uid);

View File

@@ -111,12 +111,12 @@ namespace Content.Server.GameTicking.Presets
_entityManager.EntitySysManager.GetEntitySystem<UplinkSystem>() _entityManager.EntitySysManager.GetEntitySystem<UplinkSystem>()
.AddUplink(mind.OwnedEntity, uplinkAccount, newPDA); .AddUplink(mind.OwnedEntity, uplinkAccount, newPDA);
_allOriginalNames[uplinkAccount] = mind.OwnedEntity.Name; _allOriginalNames[uplinkAccount] = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mind.OwnedEntity.Uid).EntityName;
// The PDA needs to be marked with the correct owner. // The PDA needs to be marked with the correct owner.
var pda = IoCManager.Resolve<IEntityManager>().GetComponent<PDAComponent>(newPDA.Uid); var pda = IoCManager.Resolve<IEntityManager>().GetComponent<PDAComponent>(newPDA.Uid);
_entityManager.EntitySysManager.GetEntitySystem<PDASystem>() _entityManager.EntitySysManager.GetEntitySystem<PDASystem>()
.SetOwner(pda, mind.OwnedEntity.Name); .SetOwner(pda, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(mind.OwnedEntity.Uid).EntityName);
IoCManager.Resolve<IEntityManager>().AddComponent<TraitorDeathMatchReliableOwnerTagComponent>(newPDA).UserId = mind.UserId; IoCManager.Resolve<IEntityManager>().AddComponent<TraitorDeathMatchReliableOwnerTagComponent>(newPDA).UserId = mind.UserId;
} }

View File

@@ -36,7 +36,7 @@ namespace Content.Server.Ghost.Components
msg.Channel = ChatChannel.Radio; msg.Channel = ChatChannel.Radio;
msg.Message = message; msg.Message = message;
//Square brackets are added here to avoid issues with escaping //Square brackets are added here to avoid issues with escaping
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", speaker.Name)); msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(speaker.Uid).EntityName));
_netManager.ServerSendMessage(msg, playerChannel); _netManager.ServerSendMessage(msg, playerChannel);
} }

View File

@@ -222,7 +222,7 @@ namespace Content.Server.Ghost
{ {
if (player.AttachedEntity != null) if (player.AttachedEntity != null)
{ {
players.Add(player.AttachedEntity.Uid, player.AttachedEntity.Name); players.Add(player.AttachedEntity.Uid, IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.AttachedEntity.Uid).EntityName);
} }
} }

View File

@@ -106,13 +106,13 @@ namespace Content.Server.Hands.Components
{ {
if (ActiveHand != null && Drop(ActiveHand, false)) if (ActiveHand != null && Drop(ActiveHand, false))
{ {
source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", source.Name), ("disarmed", target.Name))); source.PopupMessageOtherClients(Loc.GetString("hands-component-disarm-success-others-message", ("disarmer", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(source.Uid).EntityName), ("disarmed", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName)));
source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", target.Name))); source.PopupMessageCursor(Loc.GetString("hands-component-disarm-success-message", ("disarmed", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName)));
} }
else else
{ {
source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", source.Name), ("shoved", target.Name))); source.PopupMessageOtherClients(Loc.GetString("hands-component-shove-success-others-message", ("shover", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(source.Uid).EntityName), ("shoved", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName)));
source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", target.Name))); source.PopupMessageCursor(Loc.GetString("hands-component-shove-success-message", ("shoved", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName)));
} }
} }
} }

View File

@@ -69,7 +69,7 @@ namespace Content.Server.Headset
msg.Channel = ChatChannel.Radio; msg.Channel = ChatChannel.Radio;
msg.Message = message; msg.Message = message;
//Square brackets are added here to avoid issues with escaping //Square brackets are added here to avoid issues with escaping
msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", source.Name)); msg.MessageWrap = Loc.GetString("chat-radio-message-wrap", ("channel", $"\\[{channel}\\]"), ("name", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(source.Uid).EntityName));
_netManager.ServerSendMessage(msg, playerChannel); _netManager.ServerSendMessage(msg, playerChannel);
} }
} }

View File

@@ -329,7 +329,7 @@ namespace Content.Server.Interaction
if (target != null && !user.IsInSameOrParentContainer(target) && !CanAccessViaStorage(user.Uid, target.Uid)) if (target != null && !user.IsInSameOrParentContainer(target) && !CanAccessViaStorage(user.Uid, target.Uid))
{ {
Logger.WarningS("system.interaction", Logger.WarningS("system.interaction",
$"User entity named {user.Name} clicked on object {target.Name} that isn't the parent, child, or in the same container"); $"User entity named {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(user.Uid).EntityName} clicked on object {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName} that isn't the parent, child, or in the same container");
return; return;
} }
@@ -377,7 +377,7 @@ namespace Content.Server.Interaction
if (coordinates.GetMapId(_entityManager) != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).MapID) if (coordinates.GetMapId(_entityManager) != IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).MapID)
{ {
Logger.WarningS("system.interaction", Logger.WarningS("system.interaction",
$"User entity named {user.Name} clicked on a map they aren't located on"); $"User entity named {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(user.Uid).EntityName} clicked on a map they aren't located on");
return false; return false;
} }
@@ -471,7 +471,7 @@ namespace Content.Server.Interaction
if (targetEnt != null && !user.IsInSameOrParentContainer(targetEnt) && !CanAccessViaStorage(user.Uid, targetEnt.Uid)) if (targetEnt != null && !user.IsInSameOrParentContainer(targetEnt) && !CanAccessViaStorage(user.Uid, targetEnt.Uid))
{ {
Logger.WarningS("system.interaction", Logger.WarningS("system.interaction",
$"User entity named {user.Name} clicked on object {targetEnt.Name} that isn't the parent, child, or in the same container"); $"User entity named {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(user.Uid).EntityName} clicked on object {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(targetEnt.Uid).EntityName} that isn't the parent, child, or in the same container");
return; return;
} }

View File

@@ -2,6 +2,7 @@
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Popups; using Content.Shared.Popups;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Inventory.Components namespace Content.Server.Inventory.Components
{ {
@@ -16,22 +17,22 @@ namespace Content.Server.Inventory.Components
void IEquipped.Equipped(EquippedEventArgs eventArgs) void IEquipped.Equipped(EquippedEventArgs eventArgs)
{ {
eventArgs.User.PopupMessage("equipped " + Owner.Name); eventArgs.User.PopupMessage("equipped " + IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName);
} }
void IEquippedHand.EquippedHand(EquippedHandEventArgs eventArgs) void IEquippedHand.EquippedHand(EquippedHandEventArgs eventArgs)
{ {
eventArgs.User.PopupMessage("equipped hand " + Owner.Name); eventArgs.User.PopupMessage("equipped hand " + IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName);
} }
void IUnequipped.Unequipped(UnequippedEventArgs eventArgs) void IUnequipped.Unequipped(UnequippedEventArgs eventArgs)
{ {
eventArgs.User.PopupMessage("unequipped " + Owner.Name); eventArgs.User.PopupMessage("unequipped " + IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName);
} }
void IUnequippedHand.UnequippedHand(UnequippedHandEventArgs eventArgs) void IUnequippedHand.UnequippedHand(UnequippedHandEventArgs eventArgs)
{ {
eventArgs.User.PopupMessage("unequipped hand" + Owner.Name); eventArgs.User.PopupMessage("unequipped hand" + IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName);
} }
} }
} }

View File

@@ -41,7 +41,7 @@ namespace Content.Server.Kitchen.Components
if (!string.IsNullOrEmpty(_meatPrototype)) if (!string.IsNullOrEmpty(_meatPrototype))
{ {
var meat = IoCManager.Resolve<IEntityManager>().SpawnEntity(_meatPrototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates); var meat = IoCManager.Resolve<IEntityManager>().SpawnEntity(_meatPrototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
meat.Name = _meatName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(meat.Uid).EntityName = _meatName;
} }
if (_meatParts != 0) if (_meatParts != 0)

View File

@@ -53,7 +53,7 @@ namespace Content.Server.Labels
LabelComponent label = target.EnsureComponent<LabelComponent>(); LabelComponent label = target.EnsureComponent<LabelComponent>();
if (label.OriginalName != null) if (label.OriginalName != null)
target.Name = label.OriginalName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName = label.OriginalName;
label.OriginalName = null; label.OriginalName = null;
if (handLabeler.AssignedLabel == string.Empty) if (handLabeler.AssignedLabel == string.Empty)
@@ -63,8 +63,9 @@ namespace Content.Server.Labels
return; return;
} }
label.OriginalName = target.Name; label.OriginalName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName;
target.Name += $" ({handLabeler.AssignedLabel})"; string val = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName + $" ({handLabeler.AssignedLabel})";
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName = val;
label.CurrentLabel = handLabeler.AssignedLabel; label.CurrentLabel = handLabeler.AssignedLabel;
result = Loc.GetString("hand-labeler-successfully-applied"); result = Loc.GetString("hand-labeler-successfully-applied");
} }

View File

@@ -155,7 +155,7 @@ namespace Content.Server.Light.Components
case ExpendableLightState.Fading: case ExpendableLightState.Fading:
CurrentState = ExpendableLightState.Dead; CurrentState = ExpendableLightState.Dead;
Owner.Name = SpentName; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName = SpentName;
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription = SpentDesc; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityDescription = SpentDesc;
UpdateSpriteAndSounds(Activated); UpdateSpriteAndSounds(Activated);

View File

@@ -64,7 +64,7 @@ namespace Content.Server.Lock
args.PushText(Loc.GetString(lockComp.Locked args.PushText(Loc.GetString(lockComp.Locked
? "lock-comp-on-examined-is-locked" ? "lock-comp-on-examined-is-locked"
: "lock-comp-on-examined-is-unlocked", : "lock-comp-on-examined-is-unlocked",
("entityName", lockComp.Owner.Name))); ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(lockComp.Owner.Uid).EntityName)));
} }
public bool TryLock(EntityUid uid, IEntity user, LockComponent? lockComp = null) public bool TryLock(EntityUid uid, IEntity user, LockComponent? lockComp = null)
@@ -78,7 +78,7 @@ namespace Content.Server.Lock
if (!HasUserAccess(uid, user, quiet: false)) if (!HasUserAccess(uid, user, quiet: false))
return false; return false;
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName",lockComp.Owner.Name))); lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-lock-success", ("entityName",Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(lockComp.Owner.Uid).EntityName)));
lockComp.Locked = true; lockComp.Locked = true;
if(lockComp.LockSound != null) if(lockComp.LockSound != null)
@@ -107,7 +107,7 @@ namespace Content.Server.Lock
if (!HasUserAccess(uid, user, quiet: false)) if (!HasUserAccess(uid, user, quiet: false))
return false; return false;
lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", lockComp.Owner.Name))); lockComp.Owner.PopupMessage(user, Loc.GetString("lock-comp-do-unlock-success", ("entityName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(lockComp.Owner.Uid).EntityName)));
lockComp.Locked = false; lockComp.Locked = false;
if(lockComp.UnlockSound != null) if(lockComp.UnlockSound != null)

View File

@@ -38,7 +38,7 @@ namespace Content.Server.Medical
Verb verb = new(); Verb verb = new();
verb.Act = () => component.InsertBody(args.Using); verb.Act = () => component.InsertBody(args.Using);
verb.Category = VerbCategory.Insert; verb.Category = VerbCategory.Insert;
verb.Text = args.Using.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Uid).EntityName;
args.Verbs.Add(verb); args.Verbs.Add(verb);
} }

View File

@@ -115,7 +115,8 @@ namespace Content.Server.Mind.Components
if (Mind != null) if (Mind != null)
{ {
ghost.Name = Mind.CharacterName ?? string.Empty; string? val = Mind.CharacterName ?? string.Empty;
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = val;
Mind.TransferTo(ghost.Uid); Mind.TransferTo(ghost.Uid);
} }
}); });

View File

@@ -241,7 +241,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (!drink.Opened) if (!drink.Opened)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open", _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
("owner", drink.Owner.Name)), uid, Filter.Entities(userUid)); ("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
return true; return true;
} }
@@ -252,7 +252,7 @@ namespace Content.Server.Nutrition.EntitySystems
drinkSolution.DrainAvailable <= 0) drinkSolution.DrainAvailable <= 0)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
("entity", drink.Owner.Name)), uid, Filter.Entities(userUid)); ("entity", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
return true; return true;
} }
@@ -324,7 +324,7 @@ namespace Content.Server.Nutrition.EntitySystems
if (!drink.Opened) if (!drink.Opened)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open", _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-not-open",
("owner", drink.Owner.Name)), uid, Filter.Entities(userUid)); ("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
return true; return true;
} }
@@ -332,7 +332,7 @@ namespace Content.Server.Nutrition.EntitySystems
drinkSolution.DrainAvailable <= 0) drinkSolution.DrainAvailable <= 0)
{ {
_popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty",
("entity", drink.Owner.Name)), uid, Filter.Entities(userUid)); ("entity", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(drink.Owner.Uid).EntityName)), uid, Filter.Entities(userUid));
return true; return true;
} }

View File

@@ -1,4 +1,6 @@
using Content.Server.Objectives.Interfaces; using Content.Server.Objectives.Interfaces;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -9,7 +11,23 @@ namespace Content.Server.Objectives.Conditions
protected Mind.Mind? Target; protected Mind.Mind? Target;
public abstract IObjectiveCondition GetAssigned(Mind.Mind mind); public abstract IObjectiveCondition GetAssigned(Mind.Mind mind);
public string Title => Loc.GetString("objective-condition-kill-person-title", ("targetName", Target?.CharacterName ?? Target?.OwnedEntity?.Name ?? string.Empty)); public string Title
{
get
{
var targetName = string.Empty;
if (Target == null)
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName));
if(Target.CharacterName != null)
targetName = Target.CharacterName;
else if (Target.OwnedEntity != null)
targetName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Target.OwnedEntity.Uid).EntityName;
return Loc.GetString("objective-condition-kill-person-title", ("targetName", targetName));
}
}
public string Description => Loc.GetString("objective-condition-kill-person-description"); public string Description => Loc.GetString("objective-condition-kill-person-description");

View File

@@ -73,7 +73,8 @@ namespace Content.Server.PAI
} }
// Ownership tag // Ownership tag
component.Owner.Name = Loc.GetString("pai-system-pai-name", ("owner", args.User)); string val = Loc.GetString("pai-system-pai-name", ("owner", args.User));
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Owner.Uid).EntityName = val;
var ghostFinder = EntityManager.EnsureComponent<GhostTakeoverAvailableComponent>(uid); var ghostFinder = EntityManager.EnsureComponent<GhostTakeoverAvailableComponent>(uid);

View File

@@ -153,10 +153,10 @@ namespace Content.Server.Pointing.EntitySystems
: Loc.GetString("pointing-system-point-at-other", ("other", pointed)); : Loc.GetString("pointing-system-point-at-other", ("other", pointed));
viewerMessage = player == pointed viewerMessage = player == pointed
? Loc.GetString("pointing-system-point-at-self-others", ("otherName", player.Name), ("other", player)) ? Loc.GetString("pointing-system-point-at-self-others", ("otherName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName), ("other", player))
: Loc.GetString("pointing-system-point-at-other-others", ("otherName", player.Name), ("other", pointed)); : Loc.GetString("pointing-system-point-at-other-others", ("otherName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName), ("other", pointed));
viewerPointedAtMessage = Loc.GetString("pointing-system-point-at-you-other", ("otherName", player.Name)); viewerPointedAtMessage = Loc.GetString("pointing-system-point-at-you-other", ("otherName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName));
} }
else else
{ {
@@ -171,7 +171,7 @@ namespace Content.Server.Pointing.EntitySystems
selfMessage = Loc.GetString("pointing-system-point-at-tile", ("tileName", tileDef.DisplayName)); selfMessage = Loc.GetString("pointing-system-point-at-tile", ("tileName", tileDef.DisplayName));
viewerMessage = Loc.GetString("pointing-system-other-point-at-tile", ("otherName", player.Name), ("tileName", tileDef.DisplayName)); viewerMessage = Loc.GetString("pointing-system-other-point-at-tile", ("otherName", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.Uid).EntityName), ("tileName", tileDef.DisplayName));
} }
_pointers[session!] = _gameTiming.CurTime; _pointers[session!] = _gameTiming.CurTime;

View File

@@ -43,7 +43,7 @@ namespace Content.Server.Power.EntitySystems
return; return;
Verb verb = new(); Verb verb = new();
verb.Text = component.Container.ContainedEntity!.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.Container.ContainedEntity!.Uid).EntityName;
verb.Category = VerbCategory.Eject; verb.Category = VerbCategory.Eject;
verb.Act = () => component.RemoveItem(args.User); verb.Act = () => component.RemoveItem(args.User);
args.Verbs.Add(verb); args.Verbs.Add(verb);
@@ -60,7 +60,7 @@ namespace Content.Server.Power.EntitySystems
return; return;
Verb verb = new(); Verb verb = new();
verb.Text = args.Using.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Uid).EntityName;
verb.Category = VerbCategory.Insert; verb.Category = VerbCategory.Insert;
verb.Act = () => component.TryInsertItem(args.Using); verb.Act = () => component.TryInsertItem(args.Using);
args.Verbs.Add(verb); args.Verbs.Add(verb);

View File

@@ -52,7 +52,7 @@ namespace Content.Server.PowerCell
return; return;
Verb verb = new(); Verb verb = new();
verb.Text = args.Using.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Uid).EntityName;
verb.Category = VerbCategory.Insert; verb.Category = VerbCategory.Insert;
verb.Act = () => component.InsertCell(args.Using); verb.Act = () => component.InsertCell(args.Using);
args.Verbs.Add(verb); args.Verbs.Add(verb);

View File

@@ -173,7 +173,7 @@ namespace Content.Server.Sandbox
var card = _entityManager.SpawnEntity("CaptainIDCard", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(player.AttachedEntity.Uid).Coordinates); var card = _entityManager.SpawnEntity("CaptainIDCard", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(player.AttachedEntity.Uid).Coordinates);
UpgradeId(card); UpgradeId(card);
IoCManager.Resolve<IEntityManager>().GetComponent<IdCardComponent>(card.Uid).FullName = player.AttachedEntity.Name; IoCManager.Resolve<IEntityManager>().GetComponent<IdCardComponent>(card.Uid).FullName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(player.AttachedEntity.Uid).EntityName;
return card; return card;
} }
} }

View File

@@ -28,7 +28,7 @@ namespace Content.Server.Storage.Components
[ViewVariables] private ContainerSlot _itemContainer = default!; [ViewVariables] private ContainerSlot _itemContainer = default!;
public string SecretPartName => _secretPartNameOverride ?? Loc.GetString("comp-secret-stash-secret-part-name", ("name", Owner.Name)); public string SecretPartName => _secretPartNameOverride ?? Loc.GetString("comp-secret-stash-secret-part-name", ("name", IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName));
protected override void Initialize() protected override void Initialize()
{ {

View File

@@ -114,7 +114,12 @@ namespace Content.Server.Strip
foreach (var slot in inventory.Slots) foreach (var slot in inventory.Slots)
{ {
dictionary[slot] = inventory.GetSlotItem(slot)?.Owner.Name ?? "None"; var name = "None";
if (inventory.GetSlotItem(slot) is { } item)
name = item.Owner.Name;
dictionary[slot] = name;
} }
return dictionary; return dictionary;

View File

@@ -48,8 +48,8 @@ namespace Content.Server.Stunnable
if (target != null) if (target != null)
{ {
// TODO: Use PopupSystem // TODO: Use PopupSystem
source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", source.Name), ("target", target.Name))); source.PopupMessageOtherClients(Loc.GetString("stunned-component-disarm-success-others", ("source", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(source.Uid).EntityName), ("target", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName)));
source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", target.Name))); source.PopupMessageCursor(Loc.GetString("stunned-component-disarm-success", ("target", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName)));
} }
} }

View File

@@ -156,20 +156,20 @@ namespace Content.Server.Toilet
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedBodyComponent?>(victim.Uid, out var body) && if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedBodyComponent?>(victim.Uid, out var body) &&
body.HasPartOfType(BodyPartType.Head)) body.HasPartOfType(BodyPartType.Head))
{ {
var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", ("victim",victim.Name),("owner", Owner.Name)); var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", ("victim",Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(victim.Uid).EntityName),("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName));
victim.PopupMessageOtherClients(othersMessage); victim.PopupMessageOtherClients(othersMessage);
var selfMessage = Loc.GetString("toilet-component-suicide-head-message", ("owner", Owner.Name)); var selfMessage = Loc.GetString("toilet-component-suicide-head-message", ("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName));
victim.PopupMessage(selfMessage); victim.PopupMessage(selfMessage);
return SuicideKind.Asphyxiation; return SuicideKind.Asphyxiation;
} }
else else
{ {
var othersMessage = Loc.GetString("toilet-component-suicide-message-others",("victim", victim.Name),("owner", Owner.Name)); var othersMessage = Loc.GetString("toilet-component-suicide-message-others",("victim", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(victim.Uid).EntityName),("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName));
victim.PopupMessageOtherClients(othersMessage); victim.PopupMessageOtherClients(othersMessage);
var selfMessage = Loc.GetString("toilet-component-suicide-message", ("owner",Owner.Name)); var selfMessage = Loc.GetString("toilet-component-suicide-message", ("owner",Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName));
victim.PopupMessage(selfMessage); victim.PopupMessage(selfMessage);
return SuicideKind.Blunt; return SuicideKind.Blunt;

View File

@@ -82,7 +82,7 @@ namespace Content.Server.VendingMachines
return; return;
} }
Owner.Name = packPrototype.Name; IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner.Uid).EntityName = packPrototype.Name;
_animationDuration = TimeSpan.FromSeconds(packPrototype.AnimationDuration); _animationDuration = TimeSpan.FromSeconds(packPrototype.AnimationDuration);
_spriteName = packPrototype.SpriteName; _spriteName = packPrototype.SpriteName;
if (!string.IsNullOrEmpty(_spriteName)) if (!string.IsNullOrEmpty(_spriteName))

View File

@@ -75,7 +75,7 @@ namespace Content.Server.Weapon.Ranged.Barrels
return; return;
Verb verb = new(); Verb verb = new();
verb.Text = component.PowerCell.Owner.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.PowerCell.Owner.Uid).EntityName;
verb.Category = VerbCategory.Eject; verb.Category = VerbCategory.Eject;
verb.Act = () => component.TryEjectCell(args.User); verb.Act = () => component.TryEjectCell(args.User);
args.Verbs.Add(verb); args.Verbs.Add(verb);
@@ -92,7 +92,7 @@ namespace Content.Server.Weapon.Ranged.Barrels
return; return;
Verb verb = new(); Verb verb = new();
verb.Text = args.Using.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Uid).EntityName;
verb.Category = VerbCategory.Insert; verb.Category = VerbCategory.Insert;
verb.Act = () => component.TryInsertPowerCell(args.Using); verb.Act = () => component.TryInsertPowerCell(args.Using);
args.Verbs.Add(verb); args.Verbs.Add(verb);
@@ -111,7 +111,7 @@ namespace Content.Server.Weapon.Ranged.Barrels
return; return;
Verb verb = new(); Verb verb = new();
verb.Text = component.MagazineContainer.ContainedEntity!.Name; verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(component.MagazineContainer.ContainedEntity!.Uid).EntityName;
verb.Category = VerbCategory.Eject; verb.Category = VerbCategory.Eject;
verb.Act = () => component.RemoveMagazine(args.User); verb.Act = () => component.RemoveMagazine(args.User);
args.Verbs.Add(verb); args.Verbs.Add(verb);
@@ -140,7 +140,7 @@ namespace Content.Server.Weapon.Ranged.Barrels
// Insert mag verb // Insert mag verb
Verb insert = new(); Verb insert = new();
insert.Text = args.Using.Name; insert.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Uid).EntityName;
insert.Category = VerbCategory.Insert; insert.Category = VerbCategory.Insert;
insert.Act = () => component.InsertMagazine(args.User, args.Using); insert.Act = () => component.InsertMagazine(args.User, args.Using);
args.Verbs.Add(insert); args.Verbs.Add(insert);

View File

@@ -37,7 +37,7 @@ namespace Content.Shared.Actions.Behaviors
ActionType = actionType; ActionType = actionType;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Performer.Uid, out PerformerActions)) if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Performer.Uid, out PerformerActions))
{ {
throw new InvalidOperationException($"performer {performer.Name} tried to perform action {actionType} " + throw new InvalidOperationException($"performer {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(performer.Uid).EntityName} tried to perform action {actionType} " +
$" but the performer had no actions component," + $" but the performer had no actions component," +
" which should never occur"); " which should never occur");
} }

View File

@@ -43,8 +43,8 @@ namespace Content.Shared.Actions.Behaviors.Item
Item = item; Item = item;
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Item.Uid, out ItemActions)) if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(Item.Uid, out ItemActions))
{ {
throw new InvalidOperationException($"performer {performer.Name} tried to perform item action {actionType} " + throw new InvalidOperationException($"performer {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(performer.Uid).EntityName} tried to perform item action {actionType} " +
$" for item {Item.Name} but the item had no ItemActionsComponent," + $" for item {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Item.Uid).EntityName} but the item had no ItemActionsComponent," +
" which should never occur"); " which should never occur");
} }
} }

View File

@@ -81,7 +81,7 @@ namespace Content.Shared.Containers.ItemSlots
var itemSlots = EntityManager.EnsureComponent<ItemSlotsComponent>(uid); var itemSlots = EntityManager.EnsureComponent<ItemSlotsComponent>(uid);
slot.ContainerSlot = ContainerHelpers.EnsureContainer<ContainerSlot>(itemSlots.Owner, id); slot.ContainerSlot = ContainerHelpers.EnsureContainer<ContainerSlot>(itemSlots.Owner, id);
if (itemSlots.Slots.ContainsKey(id)) if (itemSlots.Slots.ContainsKey(id))
Logger.Error($"Duplicate item slot key. Entity: {itemSlots.Owner.Name} ({uid}), key: {id}"); Logger.Error($"Duplicate item slot key. Entity: {IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(itemSlots.Owner.Uid).EntityName} ({uid}), key: {id}");
itemSlots.Slots[id] = slot; itemSlots.Slots[id] = slot;
} }
@@ -344,7 +344,7 @@ namespace Content.Shared.Containers.ItemSlots
var verbSubject = slot.Name != string.Empty var verbSubject = slot.Name != string.Empty
? Loc.GetString(slot.Name) ? Loc.GetString(slot.Name)
: slot.Item!.Name ?? string.Empty; : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(slot.Item!.Uid).EntityName ?? string.Empty;
Verb verb = new(); Verb verb = new();
verb.Act = () => TryEjectToHands(uid, slot, args.User.Uid); verb.Act = () => TryEjectToHands(uid, slot, args.User.Uid);
@@ -379,7 +379,7 @@ namespace Content.Shared.Containers.ItemSlots
var verbSubject = slot.Name != string.Empty var verbSubject = slot.Name != string.Empty
? Loc.GetString(slot.Name) ? Loc.GetString(slot.Name)
: slot.Item!.Name ?? string.Empty; : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(slot.Item!.Uid).EntityName ?? string.Empty;
Verb takeVerb = new(); Verb takeVerb = new();
takeVerb.Act = () => TryEjectToHands(uid, slot, args.User.Uid); takeVerb.Act = () => TryEjectToHands(uid, slot, args.User.Uid);
@@ -405,7 +405,7 @@ namespace Content.Shared.Containers.ItemSlots
var verbSubject = slot.Name != string.Empty var verbSubject = slot.Name != string.Empty
? Loc.GetString(slot.Name) ? Loc.GetString(slot.Name)
: args.Using.Name ?? string.Empty; : IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using.Uid).EntityName ?? string.Empty;
Verb insertVerb = new(); Verb insertVerb = new();
insertVerb.Act = () => Insert(uid, slot, args.Using); insertVerb.Act = () => Insert(uid, slot, args.Using);