From ed279dd1a3d99eedaabecb6bf51e192c8dc694a1 Mon Sep 17 00:00:00 2001 From: mischa Date: Wed, 16 Oct 2024 12:58:40 +0200 Subject: [PATCH] shorter naming --- .../NetworkTransformHybrid2022.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs b/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs index ae9cbdde4..5e6fb7ecc 100644 --- a/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs +++ b/Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs @@ -59,12 +59,11 @@ public class NetworkTransformHybrid2022 : NetworkBehaviour public float sendInterval => 1f / sendRate; // END CUSTOM CHANGE - /// [Tooltip("Ocassionally send a full reliable state to delta compress against. This only applies to Components with SyncMethod=Unreliable.")] - public int unreliableBaselineRate = 1; - public float unreliableBaselineInterval => unreliableBaselineRate < int.MaxValue ? 1f / unreliableBaselineRate : 0; // for 1 Hz, that's 1000ms - double lastServerUnreliableBaselineTime; - double lastClientUnreliableBaselineTime; + public int baselineRate = 1; + public float baselineInterval => baselineRate < int.MaxValue ? 1f / baselineRate : 0; // for 1 Hz, that's 1000ms + double lastServerBaselineTime; + double lastClientUnreliableTime; // only sync when changed hack ///////////////////////////////////////// #if onlySyncOnChange_BANDWIDTH_SAVING @@ -252,7 +251,7 @@ protected virtual void OnClientToServerSync(Vector3? position, Quaternion? rotat // rpc ///////////////////////////////////////////////////////////////// [ClientRpc(channel = Channels.Reliable)] - void RpcServerToClientBaselineSync(Vector3? position, Quaternion? rotation, Vector3? scale) + void RpcServerToClientBaselineSync(byte baselineTick, Vector3? position, Quaternion? rotation, Vector3? scale) { Debug.LogWarning("TODO process server->client baseline"); } @@ -322,7 +321,7 @@ protected virtual void OnServerToClientDeltaSync(Vector3? position, Quaternion? void UpdateServerBaseline() { // send a reliable baseline every 1 Hz - if (NetworkTime.localTime >= lastServerUnreliableBaselineTime + unreliableBaselineInterval) + if (NetworkTime.localTime >= lastServerBaselineTime + baselineInterval) { // send snapshot without timestamp. // receiver gets it from batch timestamp to save bandwidth. @@ -335,7 +334,7 @@ void UpdateServerBaseline() syncScale ? snapshot.scale : default(Vector3?) ); - lastServerUnreliableBaselineTime = NetworkTime.localTime; + lastServerBaselineTime = NetworkTime.localTime; } }