Inline Name
This commit is contained in:
@@ -126,7 +126,7 @@ namespace Content.Server.Administration
|
||||
var username = string.Empty;
|
||||
|
||||
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 uid = session.AttachedEntity?.Uid ?? EntityUid.Invalid;
|
||||
|
||||
@@ -50,15 +50,15 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
// TODO: Remove duplication between all this and "GamePreset.OnGhostAttempt()"...
|
||||
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))
|
||||
ghost.Name = mind.Session.Name;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = mind.Session.Name;
|
||||
|
||||
mind.Visit(ghost);
|
||||
}
|
||||
else
|
||||
{
|
||||
ghost.Name = player.Name;
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(ghost.Uid).EntityName = player.Name;
|
||||
mind.TransferTo(ghost.Uid);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Content.Server.Administration.Commands
|
||||
{
|
||||
mind = new Mind.Mind(session.UserId)
|
||||
{
|
||||
CharacterName = target.Name
|
||||
CharacterName = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(target.Uid).EntityName
|
||||
};
|
||||
mind.ChangeOwningPlayer(session.UserId);
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Content.Server.Administration.Commands
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent<PDAComponent?>(equipmentEntity.Uid, out var pdaComponent) &&
|
||||
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);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using System.Text.Json;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Administration.Logs.Converters;
|
||||
|
||||
@@ -13,7 +15,7 @@ public class PlayerSessionConverter : AdminLogConverter<SerializablePlayer>
|
||||
if (value.Player.AttachedEntity != null)
|
||||
{
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user