mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
shorter naming
This commit is contained in:
parent
be18e92061
commit
ed279dd1a3
@ -59,12 +59,11 @@ public class NetworkTransformHybrid2022 : NetworkBehaviour
|
|||||||
public float sendInterval => 1f / sendRate;
|
public float sendInterval => 1f / sendRate;
|
||||||
// END CUSTOM CHANGE
|
// END CUSTOM CHANGE
|
||||||
|
|
||||||
/// <summary> </summary>
|
|
||||||
[Tooltip("Ocassionally send a full reliable state to delta compress against. This only applies to Components with SyncMethod=Unreliable.")]
|
[Tooltip("Ocassionally send a full reliable state to delta compress against. This only applies to Components with SyncMethod=Unreliable.")]
|
||||||
public int unreliableBaselineRate = 1;
|
public int baselineRate = 1;
|
||||||
public float unreliableBaselineInterval => unreliableBaselineRate < int.MaxValue ? 1f / unreliableBaselineRate : 0; // for 1 Hz, that's 1000ms
|
public float baselineInterval => baselineRate < int.MaxValue ? 1f / baselineRate : 0; // for 1 Hz, that's 1000ms
|
||||||
double lastServerUnreliableBaselineTime;
|
double lastServerBaselineTime;
|
||||||
double lastClientUnreliableBaselineTime;
|
double lastClientUnreliableTime;
|
||||||
|
|
||||||
// only sync when changed hack /////////////////////////////////////////
|
// only sync when changed hack /////////////////////////////////////////
|
||||||
#if onlySyncOnChange_BANDWIDTH_SAVING
|
#if onlySyncOnChange_BANDWIDTH_SAVING
|
||||||
@ -252,7 +251,7 @@ protected virtual void OnClientToServerSync(Vector3? position, Quaternion? rotat
|
|||||||
|
|
||||||
// rpc /////////////////////////////////////////////////////////////////
|
// rpc /////////////////////////////////////////////////////////////////
|
||||||
[ClientRpc(channel = Channels.Reliable)]
|
[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");
|
Debug.LogWarning("TODO process server->client baseline");
|
||||||
}
|
}
|
||||||
@ -322,7 +321,7 @@ protected virtual void OnServerToClientDeltaSync(Vector3? position, Quaternion?
|
|||||||
void UpdateServerBaseline()
|
void UpdateServerBaseline()
|
||||||
{
|
{
|
||||||
// send a reliable baseline every 1 Hz
|
// send a reliable baseline every 1 Hz
|
||||||
if (NetworkTime.localTime >= lastServerUnreliableBaselineTime + unreliableBaselineInterval)
|
if (NetworkTime.localTime >= lastServerBaselineTime + baselineInterval)
|
||||||
{
|
{
|
||||||
// send snapshot without timestamp.
|
// send snapshot without timestamp.
|
||||||
// receiver gets it from batch timestamp to save bandwidth.
|
// receiver gets it from batch timestamp to save bandwidth.
|
||||||
@ -335,7 +334,7 @@ void UpdateServerBaseline()
|
|||||||
syncScale ? snapshot.scale : default(Vector3?)
|
syncScale ? snapshot.scale : default(Vector3?)
|
||||||
);
|
);
|
||||||
|
|
||||||
lastServerUnreliableBaselineTime = NetworkTime.localTime;
|
lastServerBaselineTime = NetworkTime.localTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user