aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs15
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs2
-rwxr-xr-xOpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs8
3 files changed, 6 insertions, 19 deletions
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
1891 OutPacket(payPriceReply, ThrottleOutPacketType.Task); 1891 OutPacket(payPriceReply, ThrottleOutPacketType.Task);
1892 } 1892 }
1893 1893
1894 public void SendStartPingCheck(byte seq)
1895 {
1896 StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck);
1897 pc.Header.Reliable = false;
1898
1899 pc.PingID.PingID = seq;
1900 // We *could* get OldestUnacked, but it would hurt performance and not provide any benefit
1901 pc.PingID.OldestUnacked = 0;
1902
1903 OutPacket(pc, ThrottleOutPacketType.Unknown);
1904 UDPClient.m_lastStartpingTimeMS = Util.EnvironmentTickCount();
1905 }
1906
1907 public void SendKillObject(List<uint> localIDs) 1894 public void SendKillObject(List<uint> localIDs)
1908 { 1895 {
1909 // foreach (uint id in localIDs) 1896 // foreach (uint id in localIDs)
@@ -8236,7 +8223,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8236 private bool HandleAgentResume(IClientAPI sender, Packet Pack) 8223 private bool HandleAgentResume(IClientAPI sender, Packet Pack)
8237 { 8224 {
8238 m_udpClient.IsPaused = false; 8225 m_udpClient.IsPaused = false;
8239 SendStartPingCheck(m_udpClient.CurrentPingSequence++); 8226 m_udpServer.SendPing(m_udpClient);
8240 return true; 8227 return true;
8241 } 8228 }
8242 8229
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
195 195
196 private float m_burstTime; 196 private float m_burstTime;
197 197
198 public int m_lastStartpingTimeMS; 198 public double m_lastStartpingTimeMS;
199 public int m_pingMS; 199 public int m_pingMS;
200 200
201 public int PingTimeMS 201 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
1059 buf.DataLength = 12; 1059 buf.DataLength = 12;
1060 SendUDPPacket(udpClient, buf, ThrottleOutPacketType.Unknown, null, false, false); 1060 SendUDPPacket(udpClient, buf, ThrottleOutPacketType.Unknown, null, false, false);
1061 1061
1062 udpClient.m_lastStartpingTimeMS = Util.EnvironmentTickCount(); 1062 udpClient.m_lastStartpingTimeMS = Util.GetTimeStampMS();
1063 } 1063 }
1064 1064
1065 static private readonly byte[] CompletePingCheckHeader = new byte[] { 1065 static private readonly byte[] CompletePingCheckHeader = new byte[] {
@@ -1506,11 +1506,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1506 } 1506 }
1507 else if (packet.Type == PacketType.CompletePingCheck) 1507 else if (packet.Type == PacketType.CompletePingCheck)
1508 { 1508 {
1509 int t = Util.EnvironmentTickCountSubtract(udpClient.m_lastStartpingTimeMS); 1509 double t = Util.GetTimeStampMS() - udpClient.m_lastStartpingTimeMS;
1510 int c = udpClient.m_pingMS; 1510 double c = udpClient.m_pingMS;
1511 c = 800 * c + 200 * t; 1511 c = 800 * c + 200 * t;
1512 c /= 1000; 1512 c /= 1000;
1513 udpClient.m_pingMS = c; 1513 udpClient.m_pingMS = (int)c;
1514 return; 1514 return;
1515 } 1515 }
1516 1516