From 18de5c8a2da2577246485f8df100e1e155a30d56 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 29 Aug 2014 16:30:49 +0100 Subject: make use of it in GetMeshModule, and meshs are Assets not Task itens, reduce MeshModule impact on udp rate --- .../ClientStack/Linden/Caps/GetMeshModule.cs | 47 ++-------------------- 1 file changed, 4 insertions(+), 43 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/Caps') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs index 7b15284..a381a1b 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs @@ -189,9 +189,8 @@ namespace OpenSim.Region.ClientStack.Linden // Now we know when the throttle is changed by the client in the case of a root agent or by a neighbor region in the case of a child agent. public void ThrottleUpdate(ScenePresence p) { - byte[] throttles = p.ControllingClient.GetThrottlesPacked(1); UUID user = p.UUID; - int imagethrottle = ExtractTaskThrottle(throttles); + int imagethrottle = p.ControllingClient.GetAgentThrottleSilent((int)ThrottleOutPacketType.Asset); PollServiceMeshEventArgs args; if (m_pollservices.TryGetValue(user, out args)) { @@ -199,44 +198,6 @@ namespace OpenSim.Region.ClientStack.Linden } } - private int ExtractTaskThrottle(byte[] pthrottles) - { - - byte[] adjData; - int pos = 0; - - if (!BitConverter.IsLittleEndian) - { - byte[] newData = new byte[7 * 4]; - Buffer.BlockCopy(pthrottles, 0, newData, 0, 7 * 4); - - for (int i = 0; i < 7; i++) - Array.Reverse(newData, i * 4, 4); - - adjData = newData; - } - else - { - adjData = pthrottles; - } - - // 0.125f converts from bits to bytes - //int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - //pos += 4; - // int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - //pos += 4; - // int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - // pos += 4; - // int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - // pos += 4; - pos += 16; - int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - // pos += 4; - //int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); //pos += 4; - //int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); - return task; - } - private class PollServiceMeshEventArgs : PollServiceEventArgs { private List requests = @@ -425,7 +386,7 @@ namespace OpenSim.Region.ClientStack.Linden { ThrottleBytes = pBytes; lastTimeElapsed = Util.EnvironmentTickCount(); - Throttle = ThrottleOutPacketType.Task; + Throttle = ThrottleOutPacketType.Asset; m_scene = pScene; User = puser; } @@ -550,8 +511,8 @@ namespace OpenSim.Region.ClientStack.Linden // UDPSetThrottle = (int) (pimagethrottle*(100 - CapThrottleDistributon)); float udp = 1.0f - CapThrottleDistributon; - if(udp < 0.5f) - udp = 0.5f; + if(udp < 0.7f) + udp = 0.7f; UDPSetThrottle = (int) ((float)pimagethrottle * udp); if (CapSetThrottle < 4068) CapSetThrottle = 4068; // at least two discovery mesh -- cgit v1.1