mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
naming
This commit is contained in:
parent
0ada67c7b9
commit
3c5869203d
@ -61,8 +61,7 @@ public class NetworkTransformHybrid2022 : NetworkBehaviour
|
||||
[Tooltip("Ocassionally send a full reliable state to delta compress against. This only applies to Components with SyncMethod=Unreliable.")]
|
||||
public int baselineRate = 1;
|
||||
public float baselineInterval => baselineRate < int.MaxValue ? 1f / baselineRate : 0; // for 1 Hz, that's 1000ms
|
||||
double lastServerBaselineTime;
|
||||
double lastClientUnreliableTime;
|
||||
double lastBaselineTime;
|
||||
|
||||
// delta compression needs to remember 'last' to compress against.
|
||||
// this is from reliable full state serializations, not from last
|
||||
@ -250,7 +249,7 @@ void SerializeServerBaseline(NetworkWriter writer, Vector3 position, Quaternion
|
||||
// included in baseline to identify which one it was on client
|
||||
// included in deltas to ensure they are on top of the correct baseline
|
||||
lastSerializedBaselineTick = frameCount;
|
||||
lastServerBaselineTime = NetworkTime.localTime;
|
||||
lastBaselineTime = NetworkTime.localTime;
|
||||
|
||||
// set 'last'
|
||||
lastPosition = position;
|
||||
@ -500,7 +499,7 @@ protected virtual void OnServerToClientDeltaSync(byte baselineTick, Vector3? pos
|
||||
void UpdateServerBaseline(double localTime)
|
||||
{
|
||||
// send a reliable baseline every 1 Hz
|
||||
if (localTime >= lastServerBaselineTime + baselineInterval)
|
||||
if (localTime >= lastBaselineTime + baselineInterval)
|
||||
{
|
||||
// perf: get position/rotation directly. TransformSnapshot is too expensive.
|
||||
// TransformSnapshot snapshot = ConstructSnapshot();
|
||||
|
Loading…
Reference in New Issue
Block a user