Move the presentation-free inbound physics timestamp/snapshot authority and parent-relation state into AcDream.Runtime.Entities without changing their control flow. Move their dedicated tests with them and keep App consumers as borrowers during the staged J3 cutover. Validated by 26 focused Runtime tests, 232 focused App tests, the Release solution build, and 8,429 complete Release tests with five existing skips. Co-authored-by: Codex <codex@openai.com>
44 lines
1.4 KiB
C#
44 lines
1.4 KiB
C#
using AcDream.App.Input;
|
|
using AcDream.App.Net;
|
|
using AcDream.Runtime.Entities;
|
|
|
|
namespace AcDream.App.World;
|
|
|
|
internal interface IAcceptedLocalPhysicsTimestampPublisher
|
|
{
|
|
void Publish(uint serverGuid, AcceptedPhysicsTimestamps timestamps);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Publishes accepted local-player physics timestamps to the current exact
|
|
/// session without retaining the window host.
|
|
/// </summary>
|
|
internal sealed class LiveSessionLocalPhysicsTimestampPublisher
|
|
: IAcceptedLocalPhysicsTimestampPublisher
|
|
{
|
|
private readonly ILocalPlayerIdentitySource _identity;
|
|
private readonly ILiveWorldSessionSource _session;
|
|
|
|
public LiveSessionLocalPhysicsTimestampPublisher(
|
|
ILocalPlayerIdentitySource identity,
|
|
ILiveWorldSessionSource session)
|
|
{
|
|
_identity = identity ?? throw new ArgumentNullException(nameof(identity));
|
|
_session = session ?? throw new ArgumentNullException(nameof(session));
|
|
}
|
|
|
|
public void Publish(uint serverGuid, AcceptedPhysicsTimestamps timestamps)
|
|
{
|
|
if (serverGuid != _identity.ServerGuid
|
|
|| _session.CurrentSession is not { } session)
|
|
{
|
|
return;
|
|
}
|
|
|
|
session.PublishAcceptedLocalPhysicsTimestamps(
|
|
timestamps.Instance,
|
|
timestamps.ServerControlledMove,
|
|
timestamps.Teleport,
|
|
timestamps.ForcePosition);
|
|
}
|
|
}
|