mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 13:55:35 +08:00
remove redundant code
This commit is contained in:
@@ -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<uint> 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user