Skip to main content

Class NetworkTime

Synchronize time between the server and the clients

Inheritance
System.Object
Inherited Members
Show
Syntax
public class NetworkTime

Constructors

NetworkTime()

Declaration
public NetworkTime()

Fields

PingInterval

how often are we sending ping messages used to calculate network time and RTT

Declaration
public float PingInterval

PingWindowSize

average out the last few results from Ping

Declaration
public int PingWindowSize

Properties

Time

The time in seconds since the server started.

Declaration
public double Time { get; }

TimeVar

Measurement of the variance of time. The higher the variance, the less accurate the time is

Declaration
public double TimeVar { get; }

TimeSd

standard deviation of time. The higher the variance, the less accurate the time is

Declaration
public double TimeSd { get; }

Offset

Clock difference in seconds between the client and the server

Declaration
public double Offset { get; }

Rtt

how long in seconds does it take for a message to go to the server and come back

Declaration
public double Rtt { get; }

RttVar

measure variance of rtt the higher the number, the less accurate rtt is

Declaration
public double RttVar { get; }

RttSd

Measure the standard deviation of rtt the higher the number, the less accurate rtt is

Declaration
public double RttSd { get; }

Methods

Reset()

Declaration
public void Reset()

PingNow(IMessageSender)

Sends right away ignoring lastPingTime

Declaration
public void PingNow(IMessageSender client)
Parameters
TypeNameDescription
Mirage.IMessageSenderclient