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
29
src/AcDream.App/Physics/LocalForcePositionTransaction.cs
Normal file
29
src/AcDream.App/Physics/LocalForcePositionTransaction.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
namespace AcDream.App.Physics;
|
||||
|
||||
/// <summary>
|
||||
/// Preserves retail ForcePosition's atomic local order: validate the accepted
|
||||
/// Position authority, blip once, acknowledge once, then stop if the
|
||||
/// acknowledgement synchronously displaced that authority.
|
||||
/// </summary>
|
||||
internal static class LocalForcePositionTransaction
|
||||
{
|
||||
internal static bool Apply(
|
||||
bool isForcePosition,
|
||||
Func<bool> isCurrent,
|
||||
Action blip,
|
||||
Action acknowledge)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(isCurrent);
|
||||
ArgumentNullException.ThrowIfNull(blip);
|
||||
ArgumentNullException.ThrowIfNull(acknowledge);
|
||||
|
||||
if (!isForcePosition)
|
||||
return true;
|
||||
if (!isCurrent())
|
||||
return false;
|
||||
|
||||
blip();
|
||||
acknowledge();
|
||||
return isCurrent();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue