From e281876ecdb5edff737556c7200b8a902e66d05e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 18 Nov 2016 03:25:29 +0000 Subject: restore higher resolution clock on udpserver and lower uaeraccouts caching time --- OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index b491110..af33d17 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -323,10 +323,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected int m_elapsedMSSinceLastStatReport = 0; /// Environment.TickCount of the last time the outgoing packet handler executed - protected int m_tickLastOutgoingPacketHandler; + protected double m_tickLastOutgoingPacketHandler; /// Keeps track of the number of elapsed milliseconds since the last time the outgoing packet handler looped - protected int m_elapsedMSOutgoingPacketHandler; + protected double m_elapsedMSOutgoingPacketHandler; /// Keeps track of the number of 100 millisecond periods elapsed in the outgoing packet handler executed protected int m_elapsed100MSOutgoingPacketHandler; @@ -2073,21 +2073,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_sendPing = false; // Update elapsed time - int thisTick = Environment.TickCount & Int32.MaxValue; - if (m_tickLastOutgoingPacketHandler > thisTick) - m_elapsedMSOutgoingPacketHandler += ((Int32.MaxValue - m_tickLastOutgoingPacketHandler) + thisTick); - else - m_elapsedMSOutgoingPacketHandler += (thisTick - m_tickLastOutgoingPacketHandler); - - m_tickLastOutgoingPacketHandler = thisTick; + double thisTick = Util.GetTimeStampMS(); // update some 1ms resolution chained timers + m_elapsedMSOutgoingPacketHandler += thisTick - m_tickLastOutgoingPacketHandler; + m_tickLastOutgoingPacketHandler = thisTick; // Check for pending outgoing resends every 100ms - if (m_elapsedMSOutgoingPacketHandler >= 100) + if (m_elapsedMSOutgoingPacketHandler >= 100.0) { m_resendUnacked = true; - m_elapsedMSOutgoingPacketHandler = 0; + m_elapsedMSOutgoingPacketHandler = 0.0; m_elapsed100MSOutgoingPacketHandler += 1; } -- cgit v1.1