Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -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)

View File

@@ -133,8 +133,16 @@ namespace Content.Client.ContextMenu.UI
var func = args.Function;
var funcId = _inputManager.NetworkBindMap.KeyFunctionID(func);
var message = new FullInputCmdMessage(_gameTiming.CurTick, _gameTiming.TickFraction, funcId,
BoundKeyState.Down, _entityManager.GetComponent<TransformComponent>(entity.Value).Coordinates, args.PointerLocation, entity.Value);
var message = new ClientFullInputCmdMessage(
_gameTiming.CurTick,
_gameTiming.TickFraction,
funcId)
{
State = BoundKeyState.Down,
Coordinates = _entityManager.GetComponent<TransformComponent>(entity.Value).Coordinates,
ScreenCoordinates = args.PointerLocation,
Uid = entity.Value,
};
var session = _playerManager.LocalPlayer?.Session;
if (session != null)