From c74cda8382da08c73545af18f5fa829c556990db Mon Sep 17 00:00:00 2001 From: MrGadget1024 <9826063+MrGadget1024@users.noreply.github.com> Date: Mon, 27 Mar 2023 01:35:03 -0400 Subject: [PATCH] Changes per Ninja --- .../NetworkTransformReliable/NetworkTransformReliable.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Assets/Mirror/Components/NetworkTransformReliable/NetworkTransformReliable.cs b/Assets/Mirror/Components/NetworkTransformReliable/NetworkTransformReliable.cs index 1df199a8a..2441ffa3e 100644 --- a/Assets/Mirror/Components/NetworkTransformReliable/NetworkTransformReliable.cs +++ b/Assets/Mirror/Components/NetworkTransformReliable/NetworkTransformReliable.cs @@ -45,6 +45,7 @@ public class NetworkTransformReliable : NetworkTransformBase [Header("Snapshot Interpolation")] [Tooltip("Add a small timeline offset to account for decoupled arrival of NetworkTime and NetworkTransform snapshots.\nfixes: https://github.com/MirrorNetworking/Mirror/issues/3427")] public bool timelineOffset = false; + double offset => NetworkServer.sendInterval * (timelineOffset ? sendIntervalMultiplier : sendIntervalMultiplier - 1); // delta compression needs to remember 'last' to compress against protected Vector3Long lastSerializedPosition = Vector3Long.zero; @@ -320,7 +321,7 @@ protected virtual void OnClientToServerSync(Vector3? position, Quaternion? rotat // 'only sync on change' needs a correction on every new move sequence. if (onlySyncOnChange && - NeedsCorrection(serverSnapshots, connectionToClient.remoteTimeStamp, NetworkServer.sendInterval * sendIntervalMultiplier, onlySyncOnChangeInterval)) + NeedsCorrection(serverSnapshots, connectionToClient.remoteTimeStamp, NetworkServer.sendInterval * sendIntervalMultiplier, onlySyncOnChangeCorrectionMultiplier)) { RewriteHistory( serverSnapshots, @@ -337,7 +338,6 @@ protected virtual void OnClientToServerSync(Vector3? position, Quaternion? rotat // needs to be sendInterval. half sendInterval doesn't solve it. // https://github.com/MirrorNetworking/Mirror/issues/3427 // remove this after LocalWorldState. - double offset = NetworkServer.sendInterval * (timelineOffset ? sendIntervalMultiplier : sendIntervalMultiplier - 1); AddSnapshot(serverSnapshots, connectionToClient.remoteTimeStamp + offset, position, rotation, scale); } @@ -349,7 +349,7 @@ protected virtual void OnServerToClientSync(Vector3? position, Quaternion? rotat // 'only sync on change' needs a correction on every new move sequence. if (onlySyncOnChange && - NeedsCorrection(clientSnapshots, NetworkClient.connection.remoteTimeStamp, NetworkClient.sendInterval * sendIntervalMultiplier, onlySyncOnChangeInterval)) + NeedsCorrection(clientSnapshots, NetworkClient.connection.remoteTimeStamp, NetworkClient.sendInterval * sendIntervalMultiplier, onlySyncOnChangeCorrectionMultiplier)) { RewriteHistory( clientSnapshots, @@ -366,7 +366,6 @@ protected virtual void OnServerToClientSync(Vector3? position, Quaternion? rotat // needs to be sendInterval. half sendInterval doesn't solve it. // https://github.com/MirrorNetworking/Mirror/issues/3427 // remove this after LocalWorldState. - double offset = NetworkServer.sendInterval * (timelineOffset ? sendIntervalMultiplier : sendIntervalMultiplier - 1); AddSnapshot(clientSnapshots, NetworkClient.connection.remoteTimeStamp + offset, position, rotation, scale); }