aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Prioritizer.cs34
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs33
2 files changed, 45 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
index e3ed905..a7637c0 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -119,16 +119,40 @@ namespace OpenSim.Region.Framework.Scenes
119 119
120 private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity) 120 private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity)
121 { 121 {
122 return 1; 122 // And anything attached to this avatar gets top priority as well
123 if (entity is SceneObjectPart)
124 {
125 SceneObjectPart sop = (SceneObjectPart)entity;
126 if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.RootPart.AttachedAvatar)
127 return 1;
128 }
129
130 return PriorityQueue.NumberOfImmediateQueues; // first queue past the immediate queues
123 } 131 }
124 132
125 private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity) 133 private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity)
126 { 134 {
135 // And anything attached to this avatar gets top priority as well
136 if (entity is SceneObjectPart)
137 {
138 SceneObjectPart sop = (SceneObjectPart)entity;
139 if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.RootPart.AttachedAvatar)
140 return 1;
141 }
142
127 return ComputeDistancePriority(client,entity,false); 143 return ComputeDistancePriority(client,entity,false);
128 } 144 }
129 145
130 private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) 146 private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity)
131 { 147 {
148 // And anything attached to this avatar gets top priority as well
149 if (entity is SceneObjectPart)
150 {
151 SceneObjectPart sop = (SceneObjectPart)entity;
152 if (sop.ParentGroup.RootPart.IsAttachment && client.AgentId == sop.ParentGroup.RootPart.AttachedAvatar)
153 return 1;
154 }
155
132 return ComputeDistancePriority(client,entity,true); 156 return ComputeDistancePriority(client,entity,true);
133 } 157 }
134 158
@@ -172,7 +196,7 @@ namespace OpenSim.Region.Framework.Scenes
172 196
173 // m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId); 197 // m_log.WarnFormat("[PRIORITIZER] attempt to use agent {0} not in the scene",client.AgentId);
174 // throw new InvalidOperationException("Prioritization agent not defined"); 198 // throw new InvalidOperationException("Prioritization agent not defined");
175 return Int32.MaxValue; 199 return PriorityQueue.NumberOfQueues - 1;
176 } 200 }
177 201
178 // Use group position for child prims, since we are putting child prims in 202 // Use group position for child prims, since we are putting child prims in
@@ -197,8 +221,10 @@ namespace OpenSim.Region.Framework.Scenes
197 221
198 // And convert the distance to a priority queue, this computation gives queues 222 // And convert the distance to a priority queue, this computation gives queues
199 // at 10, 20, 40, 80, 160, 320, 640, and 1280m 223 // at 10, 20, 40, 80, 160, 320, 640, and 1280m
200 uint pqueue = 1; 224 uint pqueue = PriorityQueue.NumberOfImmediateQueues;
201 for (int i = 0; i < 8; i++) 225 uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues;
226
227 for (int i = 0; i < queues - 1; i++)
202 { 228 {
203 if (distance < 10 * Math.Pow(2.0,i)) 229 if (distance < 10 * Math.Pow(2.0,i))
204 break; 230 break;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 00a1487..ef0eb89 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2632,18 +2632,17 @@ namespace OpenSim.Region.Framework.Scenes
2632 cadu.GroupAccess = 0; 2632 cadu.GroupAccess = 0;
2633 cadu.Position = AbsolutePosition; 2633 cadu.Position = AbsolutePosition;
2634 cadu.regionHandle = m_rootRegionHandle; 2634 cadu.regionHandle = m_rootRegionHandle;
2635
2636 // Throttles
2635 float multiplier = 1; 2637 float multiplier = 1;
2636 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); 2638 int childRegions = m_knownChildRegions.Count;
2637 if (innacurateNeighbors != 0) 2639 if (childRegions != 0)
2638 { 2640 multiplier = 1f / childRegions;
2639 multiplier = 1f / (float)innacurateNeighbors; 2641
2640 } 2642 // Minimum throttle for a child region is 1/4 of the root region throttle
2641 if (multiplier <= 0f) 2643 if (multiplier <= 0.25f)
2642 {
2643 multiplier = 0.25f; 2644 multiplier = 0.25f;
2644 }
2645 2645
2646 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
2647 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); 2646 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
2648 cadu.Velocity = Velocity; 2647 cadu.Velocity = Velocity;
2649 2648
@@ -3039,16 +3038,14 @@ namespace OpenSim.Region.Framework.Scenes
3039 3038
3040 // Throttles 3039 // Throttles
3041 float multiplier = 1; 3040 float multiplier = 1;
3042 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); 3041 int childRegions = m_knownChildRegions.Count;
3043 if (innacurateNeighbors != 0) 3042 if (childRegions != 0)
3044 { 3043 multiplier = 1f / childRegions;
3045 multiplier = 1f / innacurateNeighbors; 3044
3046 } 3045 // Minimum throttle for a child region is 1/4 of the root region throttle
3047 if (multiplier <= 0f) 3046 if (multiplier <= 0.25f)
3048 {
3049 multiplier = 0.25f; 3047 multiplier = 0.25f;
3050 } 3048
3051 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
3052 cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); 3049 cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier);
3053 3050
3054 cAgent.HeadRotation = m_headrotation; 3051 cAgent.HeadRotation = m_headrotation;