mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkManager: serverTickInterval for convenience (prepares for remote statistics)
This commit is contained in:
parent
80abe21047
commit
6ba926bcb1
@ -39,6 +39,15 @@ public class NetworkManager : MonoBehaviour
|
||||
[Tooltip("Server Update frequency, per second. Use around 60Hz for fast paced games like Counter-Strike to minimize latency. Use around 30Hz for games like WoW to minimize computations. Use around 1-10Hz for slow paced games like EVE.")]
|
||||
public int serverTickRate = 30;
|
||||
|
||||
// tick rate is in Hz.
|
||||
// convert to interval in seconds for convenience where needed.
|
||||
//
|
||||
// send interval is 1 / sendRate.
|
||||
// but for tests we need a way to set it to exactly 0.
|
||||
// 1 / int.max would not be exactly 0, so handel that manually.
|
||||
public float serverTickInterval =>
|
||||
serverTickRate < int.MaxValue ? 1f / serverTickRate : 0; // for 30 Hz, that's 33ms
|
||||
|
||||
/// <summary>Automatically switch to this scene upon going offline (on start / on disconnect / on shutdown).</summary>
|
||||
[Header("Scene Management")]
|
||||
[Scene]
|
||||
|
Loading…
Reference in New Issue
Block a user