Skip to content

Commit

Permalink
nthybrid: OnClientToServer check ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
miwarnec committed Nov 4, 2024
1 parent 93cc817 commit 6ece0c7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@ void CmdClientToServerDelta_PositionRotation(byte baselineTick, Vector3 position
// local authority client sends sync message to server for broadcasting
protected virtual void OnClientToServerDeltaSync(byte baselineTick, Vector3? position, Quaternion? rotation)//, Vector3? scale)
{
// only apply if in client authority mode
if (syncDirection != SyncDirection.ClientToServer) return;

// ensure this delta is for our last known baseline.
// we should never apply a delta on top of a wrong baseline.
if (baselineTick != lastDeserializedBaselineTick)
Expand All @@ -294,9 +297,6 @@ protected virtual void OnClientToServerDeltaSync(byte baselineTick, Vector3? pos
return;
}

// only apply if in client authority mode
if (syncDirection != SyncDirection.ClientToServer) return;

// protect against ever-growing buffer size attacks
if (serverSnapshots.Count >= connectionToClient.snapshotBufferSizeLimit) return;

Expand Down

0 comments on commit 6ece0c7

Please sign in to comment.