public override VNetMessage Clone() { VNetMessageTimeRequest clone = (VNetMessageTimeRequest)base.Clone(); clone.currentTime = currentTime; return(clone); }
public void OnTimeRequest(VNetMessageTimeRequest timeRequest) { VNetMessageTimeReturn nmtr = new VNetMessageTimeReturn(); nmtr.clientTime = timeRequest.currentTime; nmtr.serverTime = VNetSessionTime.Inst.GetServerTimePrecise(); timeRequest._client.SendNetMessage(nmtr, false); }
public void Update(VNetClient host) { if (host != null && m_timeSyncsRemaining > 0) { m_nextTimeSync -= VNetTimer.Inst.GetFrameTimeFloat(); if (m_nextTimeSync <= 0) { m_nextTimeSync = VNetCommon.NET_TIME_SYNC_WAIT_TIME; VNetMessageTimeRequest request = new VNetMessageTimeRequest(); request.currentTime = VNetTimer.Inst.GetSystemTimeNow(); host.SendNetMessage(request, false); } } }