SyncTimeClient

In Strix Unity SDK, every room session keeps a clock that is automatically synchronized between the server and all the clients. This clock is accessible through each session’s syncTimeClient property.

The SyncTimeClient class provides the following properties:

Name

Type

Description

RTT

int

This value shows you the current round-trip time (often called ping) between the client and the server of the current session. It is specified in milliseconds.

SynchronizedTime

DateTime

This is the time value in UTC (Coordinated Universal Time) synchronized with the server. You can use this value if you need some event to happen simultaneously (or almost simultaneously) on all the clients.

SyncPeriod

int

The period of time in milliseconds between synchronizations of the clock. You can change this value to specify how often the time is synchronized with the server. By default, it is 10000 milliseconds (10 seconds).

Note

SyncTimeClient is also responsible for heartbeat messages, and SyncPeriod determines the frequency of the heartbeat. You should keep SyncPeriod a small value relative to the server’s heartbeat timeout setting.