Server-synchronized time

Online games sometimes require a synchronized clock among all participating game clients. A game event that occurs at a particular (real-world) date and time is an example; if the event would begin for some player but not yet for others, the gameplay experience could be ruined.

Although recent devices connected to the Internet often have a network-synchronized clock mechanic, usually users can opt out from the network synchronization and adjust the time manually, and we can’t rely upon the device-provided system time. (Especially in case a desynchronized clock could give some unfair benefits to cheaters.)

In Strix Unreal SDK, every channel keeps a clock that is automatically synchronized to the server clock, and clients connected to a same room server can share the synchronized time. The clock also measures the round-trip time (often abbreviated RTT or called ping) between the client and the server. Round-trip time gives an estimated network latency.

There are four functions related to the Server-synchronized time:

GetSynchronizedTime

Gets the server-synchronized time.

GetSyncRTT

Gets the round-trip time between the client and the server.

GetSyncTimePeriod

Gets the period of time between the synchronization operations.

SetSyncTimePeriod

Sets the period of time between the synchronization operations.

Note

The time is synchronized between the server every ten seconds. You can change this default time period, if required, using SetSyncTimePeriod function, by giving the desired period of time in milliseconds. (The default value of 10 seconds is represented by 10,000.)

Please note, however, that setting it too short increases the network traffic and may lead to higher server load, and setting it too long can cause loss of accuracy of synchronized time.