예제 #1
0
        public override VNetMessage Clone()
        {
            VNetMessageTimeRequest clone = (VNetMessageTimeRequest)base.Clone();

            clone.currentTime = currentTime;
            return(clone);
        }
예제 #2
0
        public void OnTimeRequest(VNetMessageTimeRequest timeRequest)
        {
            VNetMessageTimeReturn nmtr = new VNetMessageTimeReturn();

            nmtr.clientTime = timeRequest.currentTime;
            nmtr.serverTime = VNetSessionTime.Inst.GetServerTimePrecise();
            timeRequest._client.SendNetMessage(nmtr, false);
        }
예제 #3
0
 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);
         }
     }
 }