aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2011-04-25 23:26:37 +0100
committerMelanie2011-04-25 23:26:37 +0100
commita6c53b1ba281e187b3e815ff7c416a0ce5ff04e1 (patch)
treea71aa6ca35f2ccb1a410d9688616f4092c8d5e48 /OpenSim/Region/Framework
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentMerge branch 'master' into queuetest (diff)
downloadopensim-SC-a6c53b1ba281e187b3e815ff7c416a0ce5ff04e1.zip
opensim-SC-a6c53b1ba281e187b3e815ff7c416a0ce5ff04e1.tar.gz
opensim-SC-a6c53b1ba281e187b3e815ff7c416a0ce5ff04e1.tar.bz2
opensim-SC-a6c53b1ba281e187b3e815ff7c416a0ce5ff04e1.tar.xz
Merge branch 'queuetest' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework')
-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 17b2da1..ef78f0f 100644
--- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs
+++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Framework.Scenes
88 88
89 // If this is an update for our own avatar give it the highest priority 89 // If this is an update for our own avatar give it the highest priority
90 if (client.AgentId == entity.UUID) 90 if (client.AgentId == entity.UUID)
91 return PriorityQueue.ImmediateQueue; 91 return 0;
92 92
93 uint priority; 93 uint priority;
94 94
@@ -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
@@ -205,8 +229,10 @@ namespace OpenSim.Region.Framework.Scenes
205 229
206 // And convert the distance to a priority queue, this computation gives queues 230 // And convert the distance to a priority queue, this computation gives queues
207 // at 10, 20, 40, 80, 160, 320, 640, and 1280m 231 // at 10, 20, 40, 80, 160, 320, 640, and 1280m
208 uint pqueue = 1; 232 uint pqueue = PriorityQueue.NumberOfImmediateQueues;
209 for (int i = 0; i < 8; i++) 233 uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues;
234
235 for (int i = 0; i < queues - 1; i++)
210 { 236 {
211 if (distance < 10 * Math.Pow(2.0,i)) 237 if (distance < 10 * Math.Pow(2.0,i))
212 break; 238 break;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 3a5b05d..a6bdc59 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3049,18 +3049,17 @@ namespace OpenSim.Region.Framework.Scenes
3049 cadu.GroupAccess = 0; 3049 cadu.GroupAccess = 0;
3050 cadu.Position = AbsolutePosition; 3050 cadu.Position = AbsolutePosition;
3051 cadu.regionHandle = m_rootRegionHandle; 3051 cadu.regionHandle = m_rootRegionHandle;
3052
3053 // Throttles
3052 float multiplier = 1; 3054 float multiplier = 1;
3053 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); 3055 int childRegions = m_knownChildRegions.Count;
3054 if (innacurateNeighbors != 0) 3056 if (childRegions != 0)
3055 { 3057 multiplier = 1f / childRegions;
3056 multiplier = 1f / (float)innacurateNeighbors; 3058
3057 } 3059 // Minimum throttle for a child region is 1/4 of the root region throttle
3058 if (multiplier <= 0f) 3060 if (multiplier <= 0.25f)
3059 {
3060 multiplier = 0.25f; 3061 multiplier = 0.25f;
3061 }
3062 3062
3063 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
3064 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); 3063 cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier);
3065 cadu.Velocity = Velocity; 3064 cadu.Velocity = Velocity;
3066 3065
@@ -3456,16 +3455,14 @@ namespace OpenSim.Region.Framework.Scenes
3456 3455
3457 // Throttles 3456 // Throttles
3458 float multiplier = 1; 3457 float multiplier = 1;
3459 int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); 3458 int childRegions = m_knownChildRegions.Count;
3460 if (innacurateNeighbors != 0) 3459 if (childRegions != 0)
3461 { 3460 multiplier = 1f / childRegions;
3462 multiplier = 1f / innacurateNeighbors; 3461
3463 } 3462 // Minimum throttle for a child region is 1/4 of the root region throttle
3464 if (multiplier <= 0f) 3463 if (multiplier <= 0.25f)
3465 {
3466 multiplier = 0.25f; 3464 multiplier = 0.25f;
3467 } 3465
3468 //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString());
3469 cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); 3466 cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier);
3470 3467
3471 cAgent.HeadRotation = m_headrotation; 3468 cAgent.HeadRotation = m_headrotation;