diff options
author | Teravus Ovares | 2007-12-09 18:05:08 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-09 18:05:08 +0000 |
commit | 1074e5adc83bf4d28050a08312999678c97e2dd2 (patch) | |
tree | f5564819ff554f13b405fcd49b888ad5d3a23f84 | |
parent | change PacketQueue to take the byte[] throttle instead (diff) | |
download | opensim-SC_OLD-1074e5adc83bf4d28050a08312999678c97e2dd2.zip opensim-SC_OLD-1074e5adc83bf4d28050a08312999678c97e2dd2.tar.gz opensim-SC_OLD-1074e5adc83bf4d28050a08312999678c97e2dd2.tar.bz2 opensim-SC_OLD-1074e5adc83bf4d28050a08312999678c97e2dd2.tar.xz |
* Added more info to ChildAgentDataUpdate
* Added (at sdauge's suggestion) byte[] GetThrottlesPacked(float multiplier)
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/PacketQueue.cs | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index c48f53a..ff6b763 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -19,5 +19,6 @@ namespace OpenSim.Framework | |||
19 | public float AVHeight; | 19 | public float AVHeight; |
20 | public Guid AgentID; | 20 | public Guid AgentID; |
21 | public float godlevel; | 21 | public float godlevel; |
22 | public byte[] throttles; | ||
22 | } | 23 | } |
23 | } | 24 | } |
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; |