refactor(runtime): own teleport destination correlation
This commit is contained in:
parent
38b3773cb9
commit
6a063a27d4
23 changed files with 1209 additions and 487 deletions
|
|
@ -0,0 +1,37 @@
|
|||
using System.Numerics;
|
||||
using AcDream.Core.Net;
|
||||
using AcDream.Core.Physics;
|
||||
using AcDream.Runtime;
|
||||
|
||||
namespace AcDream.App.Streaming;
|
||||
|
||||
/// <summary>
|
||||
/// One-way boundary from an already accepted wire Position into Runtime's
|
||||
/// presentation-independent teleport destination. Canonical physics consumes
|
||||
/// the packet first; this adapter neither gates nor applies it.
|
||||
/// </summary>
|
||||
internal static class RuntimeTeleportDestinationAdapter
|
||||
{
|
||||
public static RuntimeTeleportDestination FromAcceptedPosition(
|
||||
in WorldSession.EntityPositionUpdate update)
|
||||
{
|
||||
var position = update.Position;
|
||||
return new RuntimeTeleportDestination(
|
||||
update.Guid,
|
||||
update.InstanceSequence,
|
||||
update.PositionSequence,
|
||||
update.TeleportSequence,
|
||||
update.ForcePositionSequence,
|
||||
new Position(
|
||||
position.LandblockId,
|
||||
new Vector3(
|
||||
position.PositionX,
|
||||
position.PositionY,
|
||||
position.PositionZ),
|
||||
new Quaternion(
|
||||
position.RotationX,
|
||||
position.RotationY,
|
||||
position.RotationZ,
|
||||
position.RotationW)));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue