refactor(world): extract live entity network updates
Move Position, Vector, State, Movement, and equal-generation CreateObject routing out of GameWindow while preserving per-channel authority, ForcePosition acknowledgement, and motion-runtime ownership. Add adversarial authority and exact-wire coverage so reentrant updates and GUID reuse cannot publish stale state.
This commit is contained in:
parent
c203e4799a
commit
aa90c64666
19 changed files with 3701 additions and 2241 deletions
34
src/AcDream.App/Physics/LiveEntityVectorRoute.cs
Normal file
34
src/AcDream.App/Physics/LiveEntityVectorRoute.cs
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
namespace AcDream.App.Physics;
|
||||
|
||||
internal enum LiveEntityVectorRoute
|
||||
{
|
||||
Projectile,
|
||||
CanonicalBody,
|
||||
OrdinaryRemote,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Pins retail's one-CPhysicsObj vector-update priority. A missile owns its
|
||||
/// canonical body first; otherwise a retained static body consumes the wire
|
||||
/// vector; only an ordinary remote reaches MovementManager storage.
|
||||
/// </summary>
|
||||
internal static class LiveEntityVectorRouter
|
||||
{
|
||||
internal static LiveEntityVectorRoute Route(
|
||||
Func<bool> tryProjectile,
|
||||
Func<bool> tryCanonicalBody,
|
||||
Action applyOrdinaryRemote)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(tryProjectile);
|
||||
ArgumentNullException.ThrowIfNull(tryCanonicalBody);
|
||||
ArgumentNullException.ThrowIfNull(applyOrdinaryRemote);
|
||||
|
||||
if (tryProjectile())
|
||||
return LiveEntityVectorRoute.Projectile;
|
||||
if (tryCanonicalBody())
|
||||
return LiveEntityVectorRoute.CanonicalBody;
|
||||
|
||||
applyOrdinaryRemote();
|
||||
return LiveEntityVectorRoute.OrdinaryRemote;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue