Example #1
0
        public override VNetMessage Clone()
        {
            VNetMessagePingClient clone = (VNetMessagePingClient)base.Clone();

            clone.timeSent = timeSent;
            return(clone);
        }
Example #2
0
        // Listener
        public void OnPing(VNetMessagePingClient ping)
        {
            if (ping._client.GetUID() != m_client.GetUID())
            {
                return;
            }

            Console.WriteLine(ping._client.GetName() + " - ping");

            // Send a pong response
            VNetMessagePongClient pong = new VNetMessagePongClient();

            pong.timeSent = ping.timeSent;
            m_client.SendNetMessage(pong, false);
        }
Example #3
0
        public void Update()
        {
            m_delay -= VNetTimer.Inst.GetFrameTimeFloat();
            if (m_delay > 0)
            {
                return;
            }

            // Reset the timer
            m_delay += VNetCommon.NET_CLIENT_PING_WAIT_TIME;

            // Send the message
            VNetMessagePingClient ping = new VNetMessagePingClient();

            ping.timeSent = VNetTimer.Inst.GetSystemTimeNow();
            m_client.SendNetMessage(ping, false);
        }