Content update for NetEntities (#18935)
This commit is contained in:
@@ -49,7 +49,8 @@ namespace Content.Client.ContextMenu.UI
|
||||
|
||||
private string? SearchPlayerName(EntityUid entity)
|
||||
{
|
||||
return _adminSystem.PlayerList.FirstOrDefault(player => player.EntityUid == entity)?.Username;
|
||||
var netEntity = _entityManager.GetNetEntity(entity);
|
||||
return _adminSystem.PlayerList.FirstOrDefault(player => player.NetEntity == netEntity)?.Username;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -77,12 +78,12 @@ namespace Content.Client.ContextMenu.UI
|
||||
var representation = _entityManager.ToPrettyString(entity);
|
||||
|
||||
var name = representation.Name;
|
||||
var id = representation.Uid;
|
||||
var id = representation.Uid.ToString();
|
||||
var prototype = representation.Prototype;
|
||||
var playerName = representation.Session?.Name ?? SearchPlayerName(entity);
|
||||
var deleted = representation.Deleted;
|
||||
|
||||
return $"{name} ({id}{(prototype != null ? $", {prototype}" : "")}{(playerName != null ? $", {playerName}" : "")}){(deleted ? "D" : "")}";
|
||||
return $"{name} ({id} / {_entityManager.GetNetEntity(entity).ToString()}{(prototype != null ? $", {prototype}" : "")}{(playerName != null ? $", {playerName}" : "")}){(deleted ? "D" : "")}";
|
||||
}
|
||||
|
||||
private string GetEntityDescription(EntityUid entity)
|
||||
|
||||
Reference in New Issue
Block a user