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

@@ -55,7 +55,7 @@ public sealed partial class ReplaySpectatorSystem
return;
}
if (!player.IsClientSide() || !HasComp<ReplaySpectatorComponent>(player))
if (!IsClientSide(player) || !HasComp<ReplaySpectatorComponent>(player))
{
// Player is trying to move -> behave like the ghost-on-move component.
SpawnSpectatorGhost(new EntityCoordinates(player, default), true);
@@ -113,12 +113,9 @@ public sealed partial class ReplaySpectatorSystem
_dir = dir;
}
public override bool HandleCmdMessage(ICommonSession? session, InputCmdMessage message)
public override bool HandleCmdMessage(IEntityManager entManager, ICommonSession? session, IFullInputCmdMessage message)
{
if (message is not FullInputCmdMessage full)
return false;
if (full.State == BoundKeyState.Down)
if (message.State == BoundKeyState.Down)
_sys.Direction |= _dir;
else
_sys.Direction &= ~_dir;

View File

@@ -167,7 +167,7 @@ public sealed partial class ReplaySpectatorSystem
private void OnDetached(EntityUid uid, ReplaySpectatorComponent component, PlayerDetachedEvent args)
{
if (uid.IsClientSide())
if (IsClientSide(uid))
QueueDel(uid);
else
RemCompDeferred(uid, component);

View File

@@ -51,7 +51,7 @@ public sealed partial class ReplaySpectatorSystem
if (old == null)
return;
if (old.Value.IsClientSide())
if (IsClientSide(old.Value))
Del(old.Value);
else
RemComp<ReplaySpectatorComponent>(old.Value);
@@ -77,7 +77,7 @@ public sealed partial class ReplaySpectatorSystem
if (old != null)
{
if (old.Value.IsClientSide())
if (IsClientSide(old.Value))
QueueDel(old.Value);
else
RemComp<ReplaySpectatorComponent>(old.Value);
@@ -100,12 +100,14 @@ public sealed partial class ReplaySpectatorSystem
return;
}
if (!EntityUid.TryParse(args[0], out var uid))
if (!NetEntity.TryParse(args[0], out var netEntity))
{
shell.WriteError(Loc.GetString("cmd-parse-failure-uid", ("arg", args[0])));
return;
}
var uid = GetEntity(netEntity);
if (!Exists(uid))
{
shell.WriteError(Loc.GetString("cmd-parse-failure-entity-exist", ("arg", args[0])));
@@ -120,7 +122,7 @@ public sealed partial class ReplaySpectatorSystem
if (args.Length != 1)
return CompletionResult.Empty;
return CompletionResult.FromHintOptions(CompletionHelper.EntityUids(args[0],
return CompletionResult.FromHintOptions(CompletionHelper.NetEntities(args[0],
EntityManager), Loc.GetString("cmd-replay-spectate-hint"));
}
}