Synchronizes server time to clients.
More...
|
static double | localTime [get] |
|
static double | time [get, set] |
| The time in seconds since the server started. More...
|
|
static double | timeVariance [get] |
| Time measurement variance. The higher, the less accurate the time is. More...
|
|
static double | timeStandardDeviation [get] |
| Time standard deviation. The highe, the less accurate the time is. More...
|
|
static double | offset [get] |
| Clock difference in seconds between the client and the server. Always 0 on server. More...
|
|
static double | rtt [get] |
| Round trip time (in seconds) that it takes a message to go client->server->client. More...
|
|
static double | rttVariance [get] |
| Round trip time variance. The higher, the less accurate the rtt is. More...
|
|
static double | rttStandardDeviation [get] |
| Round trip time standard deviation. The higher, the less accurate the rtt is. More...
|
|
Synchronizes server time to clients.
Definition at line 11 of file NetworkTime.cs.
◆ ResetStatics()
static void Mirror.NetworkTime.ResetStatics |
( |
| ) |
|
|
static |
Definition at line 86 of file NetworkTime.cs.
87 {
90 lastPingTime = 0;
93 offsetMin = double.MinValue;
94 offsetMax = double.MaxValue;
95#if !UNITY_2020_3_OR_NEWER
96 stopwatch.Restart();
97#endif
98 }
static int PingWindowSize
Average out the last few results from Ping
static float PingFrequency
Ping message frequency, used to calculate network time and RTT
◆ PingFrequency
float Mirror.NetworkTime.PingFrequency = 2.0f |
|
static |
Ping message frequency, used to calculate network time and RTT
Definition at line 14 of file NetworkTime.cs.
◆ PingWindowSize
int Mirror.NetworkTime.PingWindowSize = 10 |
|
static |
Average out the last few results from Ping
Definition at line 17 of file NetworkTime.cs.
◆ localTime
double Mirror.NetworkTime.localTime |
|
staticget |
◆ offset
double Mirror.NetworkTime.offset |
|
staticget |
Clock difference in seconds between the client and the server. Always 0 on server.
Definition at line 71 of file NetworkTime.cs.
◆ rtt
double Mirror.NetworkTime.rtt |
|
staticget |
Round trip time (in seconds) that it takes a message to go client->server->client.
Definition at line 74 of file NetworkTime.cs.
◆ rttStandardDeviation
double Mirror.NetworkTime.rttStandardDeviation |
|
staticget |
Round trip time standard deviation. The higher, the less accurate the rtt is.
Definition at line 82 of file NetworkTime.cs.
◆ rttVariance
double Mirror.NetworkTime.rttVariance |
|
staticget |
Round trip time variance. The higher, the less accurate the rtt is.
Definition at line 78 of file NetworkTime.cs.
◆ time
double Mirror.NetworkTime.time |
|
staticgetset |
The time in seconds since the server started.
Definition at line 56 of file NetworkTime.cs.
57 {
58 [MethodImpl(MethodImplOptions.AggressiveInlining)]
59 get => localTime - _offset.Value;
60 }
◆ timeStandardDeviation
double Mirror.NetworkTime.timeStandardDeviation |
|
staticget |
Time standard deviation. The highe, the less accurate the time is.
Definition at line 68 of file NetworkTime.cs.
◆ timeVariance
double Mirror.NetworkTime.timeVariance |
|
staticget |
Time measurement variance. The higher, the less accurate the time is.
Definition at line 64 of file NetworkTime.cs.