From 9ccca71c1b13ed4e12c739774ca703cfafed5480 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 17 Mar 2019 19:00:02 +0000 Subject: remove redundant code --- OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 15 +-------------- OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs | 2 +- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 8 ++++---- 3 files changed, 6 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 4f4bb61..1004b07 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -1891,19 +1891,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(payPriceReply, ThrottleOutPacketType.Task); } - public void SendStartPingCheck(byte seq) - { - StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck); - pc.Header.Reliable = false; - - pc.PingID.PingID = seq; - // We *could* get OldestUnacked, but it would hurt performance and not provide any benefit - pc.PingID.OldestUnacked = 0; - - OutPacket(pc, ThrottleOutPacketType.Unknown); - UDPClient.m_lastStartpingTimeMS = Util.EnvironmentTickCount(); - } - public void SendKillObject(List localIDs) { // foreach (uint id in localIDs) @@ -8236,7 +8223,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool HandleAgentResume(IClientAPI sender, Packet Pack) { m_udpClient.IsPaused = false; - SendStartPingCheck(m_udpClient.CurrentPingSequence++); + m_udpServer.SendPing(m_udpClient); return true; } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs index 2981337..303f505 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs @@ -195,7 +195,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private float m_burstTime; - public int m_lastStartpingTimeMS; + public double m_lastStartpingTimeMS; public int m_pingMS; public int PingTimeMS diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 79f5fe6..25e4de5 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1059,7 +1059,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP buf.DataLength = 12; SendUDPPacket(udpClient, buf, ThrottleOutPacketType.Unknown, null, false, false); - udpClient.m_lastStartpingTimeMS = Util.EnvironmentTickCount(); + udpClient.m_lastStartpingTimeMS = Util.GetTimeStampMS(); } static private readonly byte[] CompletePingCheckHeader = new byte[] { @@ -1506,11 +1506,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else if (packet.Type == PacketType.CompletePingCheck) { - int t = Util.EnvironmentTickCountSubtract(udpClient.m_lastStartpingTimeMS); - int c = udpClient.m_pingMS; + double t = Util.GetTimeStampMS() - udpClient.m_lastStartpingTimeMS; + double c = udpClient.m_pingMS; c = 800 * c + 200 * t; c /= 1000; - udpClient.m_pingMS = c; + udpClient.m_pingMS = (int)c; return; } -- cgit v1.1