aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorUbitUmarov2014-11-06 22:25:16 +0000
committerUbitUmarov2014-11-06 22:25:16 +0000
commitcaddabb5c4f62767305a589e9d818ae3457a8030 (patch)
tree89d3c6715ec83d1ce8358674b48227c9d77ee2e3 /OpenSim/Region/ClientStack
parent allow drawdistance to change between 32 and MaxDrawDistance, configurable (diff)
downloadopensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.zip
opensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.tar.gz
opensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.tar.bz2
opensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.tar.xz
scale ChildAgentThrottles with distance (internal to child server and not
root as was done before )
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs7
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs20
2 files changed, 19 insertions, 8 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index b9646c7..f2f7cf9 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -12344,7 +12344,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12344 /// <param name="throttles"></param> 12344 /// <param name="throttles"></param>
12345 public void SetChildAgentThrottle(byte[] throttles) 12345 public void SetChildAgentThrottle(byte[] throttles)
12346 { 12346 {
12347 m_udpClient.SetThrottles(throttles); 12347 SetChildAgentThrottle(throttles, 1.0f);
12348 }
12349
12350 public void SetChildAgentThrottle(byte[] throttles,float factor)
12351 {
12352 m_udpClient.SetThrottles(throttles, factor);
12348 GenericCall2 handler = OnUpdateThrottles; 12353 GenericCall2 handler = OnUpdateThrottles;
12349 if (handler != null) 12354 if (handler != null)
12350 { 12355 {
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
index 33375ff..0ae7617 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPClient.cs
@@ -340,6 +340,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
340 340
341 public void SetThrottles(byte[] throttleData) 341 public void SetThrottles(byte[] throttleData)
342 { 342 {
343 SetThrottles(throttleData, 1.0f);
344 }
345
346 public void SetThrottles(byte[] throttleData, float factor)
347 {
343 byte[] adjData; 348 byte[] adjData;
344 int pos = 0; 349 int pos = 0;
345 350
@@ -359,13 +364,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
359 } 364 }
360 365
361 // 0.125f converts from bits to bytes 366 // 0.125f converts from bits to bytes
362 int resend = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; 367 float scale = 0.125f * factor;
363 int land = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; 368 int resend = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
364 int wind = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; 369 int land = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
365 int cloud = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; 370 int wind = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
366 int task = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; 371 int cloud = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
367 int texture = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); pos += 4; 372 int task = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
368 int asset = (int)(BitConverter.ToSingle(adjData, pos) * 0.125f); 373 int texture = (int)(BitConverter.ToSingle(adjData, pos) * scale); pos += 4;
374 int asset = (int)(BitConverter.ToSingle(adjData, pos) * scale);
369 375
370 // Make sure none of the throttles are set below our packet MTU, 376 // Make sure none of the throttles are set below our packet MTU,
371 // otherwise a throttle could become permanently clogged 377 // otherwise a throttle could become permanently clogged