Struct NetworkTimeSystem
System responsible for estimating the Server
The system tries to keep the server tick (present on the client) ahead of the server, such that input commands (see ICommand
This time synchronization start taking place as soon as the first snapshot is received by the client. Because of that,
until the client Network
In the case where the client and server world are on the same process, and an IPC connection is used (see IPC), some special optimizations can be applied. E.g. In this case the client should always run 1 tick per frame (server and client update in tandem).
Inherited Members
Namespace: Unity.NetCode
Assembly: Unity.NetCode.dll
Syntax
[BurstCompile]
[WorldSystemFilter(WorldSystemFilterFlags.ClientSimulation|WorldSystemFilterFlags.ThinClientSimulation, WorldSystemFilterFlags.Default)]
[UpdateInGroup(typeof(InitializationSystemGroup))]
[UpdateAfter(typeof(UpdateWorldTimeSystem))]
public struct NetworkTimeSystem : ISystem, ISystemStartStop, ISystemCompilerGenerated
Properties
DefaultClientTickRate
A new Client
Declaration
public static ClientTickRate DefaultClientTickRate { get; }
Property Value
Type | Description |
---|---|
Client |
TimestampMS
Return a low precision real-time stamp that represents the number of milliseconds since the process started. In Development build and Editor, the maximum reported delta in between two calls of the TimestampMS is capped to 100 milliseconds.
Declaration
public static uint TimestampMS { get; }
Property Value
Type | Description |
---|---|
uint |
Remarks
The TimestampMS is mostly used for sake of time synchronization (for calculting the RTT).
Methods
ResetFixedTime()
Fixes any stray FixedTime values when domain reloads are disabled.
Declaration
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
public static void ResetFixedTime()