@@ -29,7 +29,6 @@ public sealed class PeerSimulation : IPeerSimulation
2929 private readonly SpatialGrid spatialGrid ;
3030 private readonly IdentityBoard identityBoard ;
3131 private readonly MessagePipe messagePipe ;
32- private readonly uint [ ] simulationSteps ;
3332 private readonly ITimeProvider timeProvider ;
3433 private readonly ITransport transport ;
3534 private readonly ProfileBoard profileBoard ;
@@ -84,7 +83,6 @@ public PeerSimulation(
8483 this . spatialGrid = spatialGrid ;
8584 this . identityBoard = identityBoard ;
8685 this . messagePipe = messagePipe ;
87- this . simulationSteps = simulationSteps ;
8886 this . timeProvider = timeProvider ;
8987 this . transport = transport ;
9088 this . profileBoard = profileBoard ;
@@ -244,7 +242,30 @@ private void ProcessVisibleSubjects(
244242 }
245243 else
246244 {
247- if ( resyncRequests != null && resyncRequests . Remove ( entry . Subject , out uint lastKnownSeq ) )
245+ // Only announce on delta because PlayerJoined is considered as an announcement
246+ TryAnnounceProfile ( ) ;
247+
248+ if ( subjectSnapshot . IsTeleport && view . LastSentTeleportSeq != subjectSnapshot . Seq )
249+ {
250+ // Clear the resync since the teleport has the full player state and can fulfill it
251+ resyncRequests ? . Remove ( entry . Subject ) ;
252+
253+ messagePipe . Send ( new OutgoingMessage ( observerId , new ServerMessage
254+ {
255+ Teleported = new TeleportPerformed
256+ {
257+ SubjectId = entry . Subject ,
258+ Sequence = subjectSnapshot . Seq ,
259+ ServerTick = subjectSnapshot . ServerTick ,
260+ State = CreatePlayerState ( subjectSnapshot ) ,
261+ }
262+ } , ITransport . PacketMode . RELIABLE ) ) ;
263+
264+ view . LastSentTeleportSeq = subjectSnapshot . Seq ;
265+
266+ logger . LogInformation ( $ "Broadcasting teleport from { entry . Subject } to { observerId } at { subjectSnapshot . GlobalPosition } ") ;
267+ }
268+ else if ( resyncRequests != null && resyncRequests . Remove ( entry . Subject , out uint lastKnownSeq ) )
248269 {
249270 // Try a targeted delta from the client's baseline; fall back to full state
250271 // if the baseline is evicted, the seq hasn't advanced, or all fields are within epsilon.
@@ -259,9 +280,6 @@ private void ProcessVisibleSubjects(
259280 }
260281 else
261282 SendDelta ( view . LastSentSnapshot , ITransport . PacketMode . UNRELIABLE_SEQUENCED ) ;
262-
263- // Only announce on delta because PlayerJoined is considered as an announcement
264- TryAnnounceProfile ( ) ;
265283 }
266284
267285 SyncEmoteState ( ) ;
0 commit comments