refactor(input): extract the gameplay frame

This commit is contained in:
Erik 2026-07-22 01:38:40 +02:00
parent 0bc9fda9de
commit c557038353
24 changed files with 2433 additions and 559 deletions

View file

@ -58,8 +58,7 @@ internal sealed class LiveEntityNetworkUpdateController
private readonly Func<WorldSession?> _session;
private readonly LiveEntityInboundAuthorityGate _authorityGate;
private readonly Action<WorldSession.EntityPositionUpdate> _aimTeleportDestination;
private readonly Action<WorldSession.EntityPositionUpdate, System.Numerics.Vector3>
_dumpMovementTruthServerEcho;
private readonly IMovementTruthDiagnosticSink _movementTruthDiagnostics;
private PlayerMovementController? _playerController => _playerControllerSource();
private EntityPhysicsHost? _playerHost => _playerHostSource();
@ -106,7 +105,7 @@ internal sealed class LiveEntityNetworkUpdateController
Func<WorldSession?> session,
Action<uint, AcceptedPhysicsTimestamps> publishTimestamps,
Action<WorldSession.EntityPositionUpdate> aimTeleportDestination,
Action<WorldSession.EntityPositionUpdate, System.Numerics.Vector3> dumpMovementTruthServerEcho)
IMovementTruthDiagnosticSink movementTruthDiagnostics)
{
_liveEntities = liveEntities ?? throw new ArgumentNullException(nameof(liveEntities));
_objects = objects ?? throw new ArgumentNullException(nameof(objects));
@ -140,7 +139,8 @@ internal sealed class LiveEntityNetworkUpdateController
liveEntities,
publishTimestamps);
_aimTeleportDestination = aimTeleportDestination ?? throw new ArgumentNullException(nameof(aimTeleportDestination));
_dumpMovementTruthServerEcho = dumpMovementTruthServerEcho ?? throw new ArgumentNullException(nameof(dumpMovementTruthServerEcho));
_movementTruthDiagnostics = movementTruthDiagnostics
?? throw new ArgumentNullException(nameof(movementTruthDiagnostics));
}
internal void ResetSessionState() => _authorityGate.ResetSessionState();
@ -1106,7 +1106,7 @@ internal sealed class LiveEntityNetworkUpdateController
var rot = timestampDisposition is AcDream.Core.Physics.PositionTimestampDisposition.ForcePosition
? entity.Rotation
: new System.Numerics.Quaternion(p.RotationX, p.RotationY, p.RotationZ, p.RotationW);
_dumpMovementTruthServerEcho(update, worldPos);
_movementTruthDiagnostics.OnServerEcho(update, worldPos);
bool remoteHardTeleport = update.Guid != _playerServerGuid
&& timestamps.TeleportHookRequired;