feat(net): port retail physics spawn and event timestamps

Parse the complete PhysicsDesc plus F754/F755 packets, correct every PhysicsState bit, and gate all nine retail update channels with generation-safe immutable snapshots. Preserve ForcePosition, teleport, placement, velocity, parent, pickup, delete, and same-generation CreateObject ordering from the named client.

Separate accepted logical lifecycle notifications from retained UI qualities, make GUID replacement and session reset clear every projection exactly once, and add packet, wraparound, malformed-input, parent FIFO, canonical-position, reconnect, and GUID-reuse conformance coverage.

Co-Authored-By: Codex <noreply@openai.com>
This commit is contained in:
Erik 2026-07-14 00:22:17 +02:00
parent d53fe30ffe
commit 8a5d77f7f4
50 changed files with 3809 additions and 649 deletions

View file

@ -21,6 +21,7 @@ public enum SelectionChangeReason
SelectedObjectRemoved,
CombatTargetDied,
PreviousSelection,
SessionReset,
}
public readonly record struct SelectionTransition(
@ -68,6 +69,30 @@ public sealed class SelectionState : ISelectionService
=> PreviousObjectId is uint previous
&& Set(previous, source, SelectionChangeReason.PreviousSelection);
/// <summary>
/// Ends a world session. Unlike an ordinary selection clear, no previous
/// object survives for the next session: server GUIDs may be reused by a
/// different logical incarnation after reconnect.
/// </summary>
public bool Reset(SelectionChangeSource source = SelectionChangeSource.System)
{
uint? old = SelectedObjectId;
SelectedObjectId = null;
PreviousObjectId = null;
PreviousValidObjectId = null;
if (old is null)
return false;
var transition = new SelectionTransition(
old,
null,
source,
SelectionChangeReason.SessionReset);
Changed?.Invoke(transition);
DispatchPluginChanged(new SelectionChangedEvent(old, null));
return true;
}
bool ISelectionService.Select(uint objectId)
=> Select(objectId, SelectionChangeSource.Plugin);