From 1074e5adc83bf4d28050a08312999678c97e2dd2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sun, 9 Dec 2007 18:05:08 +0000 Subject: [PATCH] * Added more info to ChildAgentDataUpdate * Added (at sdauge's suggestion) byte[] GetThrottlesPacked(float multiplier) --- OpenSim/Framework/ChildAgentDataUpdate.cs | 1 + OpenSim/Region/ClientStack/PacketQueue.cs | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) 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;