aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/PacketQueue.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-09 18:05:08 +0000
committerTeravus Ovares2007-12-09 18:05:08 +0000
commit1074e5adc83bf4d28050a08312999678c97e2dd2 (patch)
treef5564819ff554f13b405fcd49b888ad5d3a23f84 /OpenSim/Region/ClientStack/PacketQueue.cs
parentchange PacketQueue to take the byte[] throttle instead (diff)
downloadopensim-SC-1074e5adc83bf4d28050a08312999678c97e2dd2.zip
opensim-SC-1074e5adc83bf4d28050a08312999678c97e2dd2.tar.gz
opensim-SC-1074e5adc83bf4d28050a08312999678c97e2dd2.tar.bz2
opensim-SC-1074e5adc83bf4d28050a08312999678c97e2dd2.tar.xz
* Added more info to ChildAgentDataUpdate
* Added (at sdauge's suggestion) byte[] GetThrottlesPacked(float multiplier)
Diffstat (limited to 'OpenSim/Region/ClientStack/PacketQueue.cs')
-rw-r--r--OpenSim/Region/ClientStack/PacketQueue.cs22
1 files changed, 22 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/PacketQueue.cs b/OpenSim/Region/ClientStack/PacketQueue.cs
index ca878bb..51e8b72 100644
--- a/OpenSim/Region/ClientStack/PacketQueue.cs
+++ b/OpenSim/Region/ClientStack/PacketQueue.cs
@@ -329,7 +329,29 @@ namespace OpenSim.Region.ClientStack
329 { 329 {
330 return (int)(((float)value/(float)curmax) * newmax); 330 return (int)(((float)value/(float)curmax) * newmax);
331 } 331 }
332 private byte[] GetThrottlesPacked(float multiplier)
333 {
334 int singlefloat = 4;
335 float tResend = ResendThrottle.Throttle * multiplier;
336 float tLand = LandThrottle.Throttle * multiplier;
337 float tWind = WindThrottle.Throttle * multiplier;
338 float tCloud = CloudThrottle.Throttle * multiplier;
339 float tTask = TaskThrottle.Throttle * multiplier;
340 float tTexture = TextureThrottle.Throttle * multiplier;
341 float tAsset = AssetThrottle.Throttle * multiplier;
332 342
343 byte[] throttles = new byte[singlefloat * 7];
344 int i = 0;
345 Buffer.BlockCopy(BitConverter.GetBytes(tResend), 0, throttles, singlefloat * i, singlefloat); i++;
346 Buffer.BlockCopy(BitConverter.GetBytes(tLand), 0, throttles, singlefloat * i, singlefloat); i++;
347 Buffer.BlockCopy(BitConverter.GetBytes(tWind), 0, throttles, singlefloat * i, singlefloat); i++;
348 Buffer.BlockCopy(BitConverter.GetBytes(tCloud), 0, throttles, singlefloat * i, singlefloat); i++;
349 Buffer.BlockCopy(BitConverter.GetBytes(tTask), 0, throttles, singlefloat * i, singlefloat); i++;
350 Buffer.BlockCopy(BitConverter.GetBytes(tTexture), 0, throttles, singlefloat * i, singlefloat); i++;
351 Buffer.BlockCopy(BitConverter.GetBytes(tAsset), 0, throttles, singlefloat * i, singlefloat);
352
353 return throttles;
354 }
333 public void SetThrottleFromClient(byte[] throttle) 355 public void SetThrottleFromClient(byte[] throttle)
334 { 356 {
335 int tResend = -1; 357 int tResend = -1;