mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
nthybrid: OnClientToServer check ordering
This commit is contained in:
parent
93cc81707a
commit
6ece0c7d71
@ -278,6 +278,9 @@ void CmdClientToServerDelta_PositionRotation(byte baselineTick, Vector3 position
|
|||||||
// local authority client sends sync message to server for broadcasting
|
// local authority client sends sync message to server for broadcasting
|
||||||
protected virtual void OnClientToServerDeltaSync(byte baselineTick, Vector3? position, Quaternion? rotation)//, Vector3? scale)
|
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.
|
// ensure this delta is for our last known baseline.
|
||||||
// we should never apply a delta on top of a wrong baseline.
|
// we should never apply a delta on top of a wrong baseline.
|
||||||
if (baselineTick != lastDeserializedBaselineTick)
|
if (baselineTick != lastDeserializedBaselineTick)
|
||||||
@ -294,9 +297,6 @@ protected virtual void OnClientToServerDeltaSync(byte baselineTick, Vector3? pos
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only apply if in client authority mode
|
|
||||||
if (syncDirection != SyncDirection.ClientToServer) return;
|
|
||||||
|
|
||||||
// protect against ever-growing buffer size attacks
|
// protect against ever-growing buffer size attacks
|
||||||
if (serverSnapshots.Count >= connectionToClient.snapshotBufferSizeLimit) return;
|
if (serverSnapshots.Count >= connectionToClient.snapshotBufferSizeLimit) return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user