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
|
|
@ -121,6 +121,47 @@ public sealed class LocalPlayerOutboundController
|
|||
controller.SimTimeSeconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retail ForcePosition acknowledgement sent immediately after the local
|
||||
/// body is blipped. Unlike the periodic post-network sender, this bypasses
|
||||
/// the elapsed/difference predicate but still requires a valid grounded
|
||||
/// canonical frame.
|
||||
/// </summary>
|
||||
internal void SendImmediatePosition(
|
||||
WorldSession? session,
|
||||
PlayerMovementController? controller)
|
||||
{
|
||||
if (session is null
|
||||
|| controller is null
|
||||
|| !controller.CanSendPositionEvent)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!controller.TryGetOutboundPosition(out Position outboundPosition))
|
||||
return;
|
||||
uint cellId = outboundPosition.ObjCellId;
|
||||
Vector3 position = outboundPosition.Frame.Origin;
|
||||
Quaternion rotation = outboundPosition.Frame.Orientation;
|
||||
|
||||
uint sequence = session.NextGameActionSequence();
|
||||
byte[] body = AutonomousPosition.Build(
|
||||
gameActionSequence: sequence,
|
||||
cellId: cellId,
|
||||
position: position,
|
||||
rotation: rotation,
|
||||
instanceSequence: session.InstanceSequence,
|
||||
serverControlSequence: session.ServerControlSequence,
|
||||
teleportSequence: session.TeleportSequence,
|
||||
forcePositionSequence: session.ForcePositionSequence,
|
||||
lastContact: 1);
|
||||
session.SendGameAction(body);
|
||||
controller.NotePositionSent(
|
||||
outboundPosition,
|
||||
controller.ContactPlane,
|
||||
controller.SimTimeSeconds);
|
||||
}
|
||||
|
||||
public bool TrySendMovement(
|
||||
WorldSession? session,
|
||||
PlayerMovementController? controller,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue