diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index c48f53a8cc..ff6b763d69 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -19,5 +19,6 @@ namespace OpenSim.Framework public float AVHeight; public Guid AgentID; public float godlevel; + public byte[] throttles; } } diff --git a/OpenSim/Region/ClientStack/PacketQueue.cs b/OpenSim/Region/ClientStack/PacketQueue.cs index ca878bb309..51e8b72ec3 100644 --- a/OpenSim/Region/ClientStack/PacketQueue.cs +++ b/OpenSim/Region/ClientStack/PacketQueue.cs @@ -329,7 +329,29 @@ namespace OpenSim.Region.ClientStack { return (int)(((float)value/(float)curmax) * newmax); } + private byte[] GetThrottlesPacked(float multiplier) + { + int singlefloat = 4; + float tResend = ResendThrottle.Throttle * multiplier; + float tLand = LandThrottle.Throttle * multiplier; + float tWind = WindThrottle.Throttle * multiplier; + float tCloud = CloudThrottle.Throttle * multiplier; + float tTask = TaskThrottle.Throttle * multiplier; + float tTexture = TextureThrottle.Throttle * multiplier; + float tAsset = AssetThrottle.Throttle * multiplier; + byte[] throttles = new byte[singlefloat * 7]; + int i = 0; + Buffer.BlockCopy(BitConverter.GetBytes(tResend), 0, throttles, singlefloat * i, singlefloat); i++; + Buffer.BlockCopy(BitConverter.GetBytes(tLand), 0, throttles, singlefloat * i, singlefloat); i++; + Buffer.BlockCopy(BitConverter.GetBytes(tWind), 0, throttles, singlefloat * i, singlefloat); i++; + Buffer.BlockCopy(BitConverter.GetBytes(tCloud), 0, throttles, singlefloat * i, singlefloat); i++; + Buffer.BlockCopy(BitConverter.GetBytes(tTask), 0, throttles, singlefloat * i, singlefloat); i++; + Buffer.BlockCopy(BitConverter.GetBytes(tTexture), 0, throttles, singlefloat * i, singlefloat); i++; + Buffer.BlockCopy(BitConverter.GetBytes(tAsset), 0, throttles, singlefloat * i, singlefloat); + + return throttles; + } public void SetThrottleFromClient(byte[] throttle) { int tResend = -1;