diff options
author | UbitUmarov | 2018-11-07 20:32:39 +0000 |
---|---|---|
committer | UbitUmarov | 2018-11-07 20:32:39 +0000 |
commit | ad8ddb8a781ae0da6780f74b91ebcaf338174569 (patch) | |
tree | 1df4035f0577ba29120b3c48bc0ffa6b15dbec40 /OpenSim | |
parent | change region gettexture response if presence not found (diff) | |
download | opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.zip opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.tar.gz opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.tar.bz2 opensim-SC-ad8ddb8a781ae0da6780f74b91ebcaf338174569.tar.xz |
changes to objects updates prioritizing getting dust on my disk. Schemes reduced to SimpleAngularDistance and BestAvatarResponsiveness
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/PriorityQueue.cs | 147 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 84 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 6 |
4 files changed, 106 insertions, 143 deletions
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs index 22ffcdc..20d2049 100644 --- a/OpenSim/Framework/PriorityQueue.cs +++ b/OpenSim/Framework/PriorityQueue.cs | |||
@@ -52,6 +52,9 @@ namespace OpenSim.Framework | |||
52 | /// Number of queuest (priorities) that are processed immediately | 52 | /// Number of queuest (priorities) that are processed immediately |
53 | /// </summary. | 53 | /// </summary. |
54 | public const uint NumberOfImmediateQueues = 2; | 54 | public const uint NumberOfImmediateQueues = 2; |
55 | // first queues are immediate, so no counts | ||
56 | private static readonly uint[] m_queueCounts = {0, 0, 8, 8, 5, 4, 3, 2, 1, 1, 1, 1}; | ||
57 | // this is ava, ava, attach, <10m, 20,40,80,160m,320,640,1280, + | ||
55 | 58 | ||
56 | private MinHeap<MinHeapItem>[] m_heaps = new MinHeap<MinHeapItem>[NumberOfQueues]; | 59 | private MinHeap<MinHeapItem>[] m_heaps = new MinHeap<MinHeapItem>[NumberOfQueues]; |
57 | private Dictionary<uint, LookupItem> m_lookupTable; | 60 | private Dictionary<uint, LookupItem> m_lookupTable; |
@@ -61,10 +64,8 @@ namespace OpenSim.Framework | |||
61 | // each pass. weighted towards the higher priority queues | 64 | // each pass. weighted towards the higher priority queues |
62 | private uint m_nextQueue = 0; | 65 | private uint m_nextQueue = 0; |
63 | private uint m_countFromQueue = 0; | 66 | private uint m_countFromQueue = 0; |
64 | // first queues are imediate, so no counts | 67 | private int m_capacity; |
65 | // private uint[] m_queueCounts = { 0, 0, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1 }; | 68 | private int m_added; |
66 | private uint[] m_queueCounts = {0, 0, 8, 8, 5, 4, 3, 2, 1, 1, 1, 1}; | ||
67 | // this is ava, ava, attach, <10m, 20,40,80,160m,320,640,1280, + | ||
68 | 69 | ||
69 | // next request is a counter of the number of updates queued, it provides | 70 | // next request is a counter of the number of updates queued, it provides |
70 | // a total ordering on the updates coming through the queue and is more | 71 | // a total ordering on the updates coming through the queue and is more |
@@ -84,17 +85,29 @@ namespace OpenSim.Framework | |||
84 | 85 | ||
85 | public PriorityQueue(int capacity) | 86 | public PriorityQueue(int capacity) |
86 | { | 87 | { |
87 | m_lookupTable = new Dictionary<uint, LookupItem>(capacity); | 88 | m_capacity = capacity; |
89 | capacity /= 4; | ||
88 | 90 | ||
89 | for (int i = 0; i < m_heaps.Length; ++i) | 91 | for (int i = 0; i < m_heaps.Length; ++i) |
90 | m_heaps[i] = new MinHeap<MinHeapItem>(capacity); | 92 | m_heaps[i] = new MinHeap<MinHeapItem>(capacity); |
91 | 93 | ||
94 | m_lookupTable = new Dictionary<uint, LookupItem>(m_capacity); | ||
92 | m_nextQueue = NumberOfImmediateQueues; | 95 | m_nextQueue = NumberOfImmediateQueues; |
93 | m_countFromQueue = m_queueCounts[m_nextQueue]; | 96 | m_countFromQueue = m_queueCounts[m_nextQueue]; |
97 | m_added = 0; | ||
94 | } | 98 | } |
95 | #endregion Constructor | 99 | #endregion Constructor |
96 | 100 | ||
97 | #region PublicMethods | 101 | #region PublicMethods |
102 | public void Close() | ||
103 | { | ||
104 | for (int i = 0; i < m_heaps.Length; ++i) | ||
105 | m_heaps[i] = null; | ||
106 | m_heaps = null; | ||
107 | m_lookupTable.Clear(); | ||
108 | m_lookupTable = null; | ||
109 | } | ||
110 | |||
98 | /// <summary> | 111 | /// <summary> |
99 | /// Return the number of items in the queues | 112 | /// Return the number of items in the queues |
100 | /// </summary> | 113 | /// </summary> |
@@ -116,14 +129,21 @@ namespace OpenSim.Framework | |||
116 | public bool Enqueue(uint pqueue, EntityUpdate value) | 129 | public bool Enqueue(uint pqueue, EntityUpdate value) |
117 | { | 130 | { |
118 | LookupItem lookup; | 131 | LookupItem lookup; |
132 | IHandle lookupH; | ||
133 | UInt64 entry; | ||
119 | 134 | ||
120 | uint localid = value.Entity.LocalId; | 135 | uint localid = value.Entity.LocalId; |
121 | UInt64 entry = m_nextRequest++; | ||
122 | if (m_lookupTable.TryGetValue(localid, out lookup)) | 136 | if (m_lookupTable.TryGetValue(localid, out lookup)) |
123 | { | 137 | { |
124 | entry = lookup.Heap[lookup.Handle].EntryOrder; | 138 | lookupH = lookup.Handle; |
125 | value.Update(lookup.Heap[lookup.Handle].Value); | 139 | entry = lookup.Heap[lookupH].EntryOrder; |
126 | lookup.Heap.Remove(lookup.Handle); | 140 | value.Update(lookup.Heap[lookupH].Value); |
141 | lookup.Heap.Remove(lookupH); | ||
142 | } | ||
143 | else | ||
144 | { | ||
145 | entry = m_nextRequest++; | ||
146 | ++m_added; | ||
127 | } | 147 | } |
128 | 148 | ||
129 | pqueue = Util.Clamp<uint>(pqueue, 0, NumberOfQueues - 1); | 149 | pqueue = Util.Clamp<uint>(pqueue, 0, NumberOfQueues - 1); |
@@ -134,7 +154,6 @@ namespace OpenSim.Framework | |||
134 | return true; | 154 | return true; |
135 | } | 155 | } |
136 | 156 | ||
137 | |||
138 | public void Remove(List<uint> ids) | 157 | public void Remove(List<uint> ids) |
139 | { | 158 | { |
140 | LookupItem lookup; | 159 | LookupItem lookup; |
@@ -147,6 +166,11 @@ namespace OpenSim.Framework | |||
147 | m_lookupTable.Remove(localid); | 166 | m_lookupTable.Remove(localid); |
148 | } | 167 | } |
149 | } | 168 | } |
169 | if(m_lookupTable.Count == 0 && m_added > 8 * m_capacity) | ||
170 | { | ||
171 | m_lookupTable = new Dictionary<uint, LookupItem>(m_capacity); | ||
172 | m_added = 0; | ||
173 | } | ||
150 | } | 174 | } |
151 | 175 | ||
152 | /// <summary> | 176 | /// <summary> |
@@ -156,8 +180,9 @@ namespace OpenSim.Framework | |||
156 | /// </summary> | 180 | /// </summary> |
157 | public bool TryDequeue(out EntityUpdate value, out Int32 timeinqueue) | 181 | public bool TryDequeue(out EntityUpdate value, out Int32 timeinqueue) |
158 | { | 182 | { |
159 | // If there is anything in imediate queues, return it first no | 183 | // If there is anything in immediate queues, return it first no |
160 | // matter what else. Breaks fairness. But very useful. | 184 | // matter what else. Breaks fairness. But very useful. |
185 | |||
161 | for (int iq = 0; iq < NumberOfImmediateQueues; iq++) | 186 | for (int iq = 0; iq < NumberOfImmediateQueues; iq++) |
162 | { | 187 | { |
163 | if (m_heaps[iq].Count > 0) | 188 | if (m_heaps[iq].Count > 0) |
@@ -177,12 +202,13 @@ namespace OpenSim.Framework | |||
177 | // to give lower numbered queues a higher priority and higher percentage | 202 | // to give lower numbered queues a higher priority and higher percentage |
178 | // of the bandwidth. | 203 | // of the bandwidth. |
179 | 204 | ||
205 | MinHeap<MinHeapItem> curheap = m_heaps[m_nextQueue]; | ||
180 | // Check for more items to be pulled from the current queue | 206 | // Check for more items to be pulled from the current queue |
181 | if (m_heaps[m_nextQueue].Count > 0 && m_countFromQueue > 0) | 207 | if (m_countFromQueue > 0 && curheap.Count > 0) |
182 | { | 208 | { |
183 | m_countFromQueue--; | 209 | --m_countFromQueue; |
184 | 210 | ||
185 | MinHeapItem item = m_heaps[m_nextQueue].RemoveMin(); | 211 | MinHeapItem item = curheap.RemoveMin(); |
186 | m_lookupTable.Remove(item.Value.Entity.LocalId); | 212 | m_lookupTable.Remove(item.Value.Entity.LocalId); |
187 | timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); | 213 | timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); |
188 | value = item.Value; | 214 | value = item.Value; |
@@ -196,35 +222,40 @@ namespace OpenSim.Framework | |||
196 | m_nextQueue++; | 222 | m_nextQueue++; |
197 | if(m_nextQueue >= NumberOfQueues) | 223 | if(m_nextQueue >= NumberOfQueues) |
198 | m_nextQueue = NumberOfImmediateQueues; | 224 | m_nextQueue = NumberOfImmediateQueues; |
225 | |||
226 | curheap = m_heaps[m_nextQueue]; | ||
227 | if (curheap.Count == 0) | ||
228 | continue; | ||
199 | 229 | ||
200 | m_countFromQueue = m_queueCounts[m_nextQueue]; | 230 | m_countFromQueue = m_queueCounts[m_nextQueue]; |
231 | --m_countFromQueue; | ||
201 | 232 | ||
202 | if (m_heaps[m_nextQueue].Count > 0) | 233 | MinHeapItem item = curheap.RemoveMin(); |
203 | { | 234 | m_lookupTable.Remove(item.Value.Entity.LocalId); |
204 | m_countFromQueue--; | 235 | timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); |
205 | 236 | value = item.Value; | |
206 | MinHeapItem item = m_heaps[m_nextQueue].RemoveMin(); | 237 | return true; |
207 | m_lookupTable.Remove(item.Value.Entity.LocalId); | ||
208 | timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); | ||
209 | value = item.Value; | ||
210 | return true; | ||
211 | } | ||
212 | } | 238 | } |
213 | 239 | ||
214 | timeinqueue = 0; | 240 | timeinqueue = 0; |
215 | value = default(EntityUpdate); | 241 | value = default(EntityUpdate); |
242 | if(m_lookupTable.Count == 0 && m_added > 8 * m_capacity) | ||
243 | { | ||
244 | m_lookupTable = new Dictionary<uint, LookupItem>(m_capacity); | ||
245 | m_added = 0; | ||
246 | } | ||
216 | return false; | 247 | return false; |
217 | } | 248 | } |
218 | 249 | ||
219 | public bool TryOrderedDequeue(out EntityUpdate value, out Int32 timeinqueue) | 250 | public bool TryOrderedDequeue(out EntityUpdate value, out Int32 timeinqueue) |
220 | { | 251 | { |
221 | // If there is anything in imediate queues, return it first no | 252 | MinHeap<MinHeapItem> curheap; |
222 | // matter what else. Breaks fairness. But very useful. | 253 | for (int iq = 0; iq < NumberOfQueues; ++iq) |
223 | for (int iq = 0; iq < NumberOfQueues; iq++) | ||
224 | { | 254 | { |
225 | if (m_heaps[iq].Count > 0) | 255 | curheap = m_heaps[iq]; |
256 | if (curheap.Count > 0) | ||
226 | { | 257 | { |
227 | MinHeapItem item = m_heaps[iq].RemoveMin(); | 258 | MinHeapItem item = curheap.RemoveMin(); |
228 | m_lookupTable.Remove(item.Value.Entity.LocalId); | 259 | m_lookupTable.Remove(item.Value.Entity.LocalId); |
229 | timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); | 260 | timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime); |
230 | value = item.Value; | 261 | value = item.Value; |
@@ -234,6 +265,11 @@ namespace OpenSim.Framework | |||
234 | 265 | ||
235 | timeinqueue = 0; | 266 | timeinqueue = 0; |
236 | value = default(EntityUpdate); | 267 | value = default(EntityUpdate); |
268 | if(m_lookupTable.Count == 0 && m_added > 8 * m_capacity) | ||
269 | { | ||
270 | m_lookupTable = new Dictionary<uint, LookupItem>(m_capacity); | ||
271 | m_added = 0; | ||
272 | } | ||
237 | return false; | 273 | return false; |
238 | } | 274 | } |
239 | 275 | ||
@@ -244,7 +280,7 @@ namespace OpenSim.Framework | |||
244 | public void Reprioritize(UpdatePriorityHandler handler) | 280 | public void Reprioritize(UpdatePriorityHandler handler) |
245 | { | 281 | { |
246 | MinHeapItem item; | 282 | MinHeapItem item; |
247 | foreach (LookupItem lookup in new List<LookupItem>(this.m_lookupTable.Values)) | 283 | foreach (LookupItem lookup in new List<LookupItem>(m_lookupTable.Values)) |
248 | { | 284 | { |
249 | if (lookup.Heap.TryGetValue(lookup.Handle, out item)) | 285 | if (lookup.Heap.TryGetValue(lookup.Handle, out item)) |
250 | { | 286 | { |
@@ -270,7 +306,7 @@ namespace OpenSim.Framework | |||
270 | { | 306 | { |
271 | // m_log.WarnFormat("[PQUEUE]: UpdatePriorityHandler returned false for {0}",item.Value.Entity.UUID); | 307 | // m_log.WarnFormat("[PQUEUE]: UpdatePriorityHandler returned false for {0}",item.Value.Entity.UUID); |
272 | lookup.Heap.Remove(lookup.Handle); | 308 | lookup.Heap.Remove(lookup.Handle); |
273 | this.m_lookupTable.Remove(localid); | 309 | m_lookupTable.Remove(localid); |
274 | } | 310 | } |
275 | } | 311 | } |
276 | } | 312 | } |
@@ -292,48 +328,55 @@ namespace OpenSim.Framework | |||
292 | private struct MinHeapItem : IComparable<MinHeapItem> | 328 | private struct MinHeapItem : IComparable<MinHeapItem> |
293 | { | 329 | { |
294 | private EntityUpdate value; | 330 | private EntityUpdate value; |
295 | internal EntityUpdate Value { | 331 | internal EntityUpdate Value |
296 | get { | 332 | { |
297 | return this.value; | 333 | get |
334 | { | ||
335 | return value; | ||
298 | } | 336 | } |
299 | } | 337 | } |
300 | 338 | ||
301 | private uint pqueue; | 339 | private uint pqueue; |
302 | internal uint PriorityQueue { | 340 | internal uint PriorityQueue |
303 | get { | 341 | { |
304 | return this.pqueue; | 342 | get |
343 | { | ||
344 | return pqueue; | ||
305 | } | 345 | } |
306 | } | 346 | } |
307 | 347 | ||
308 | private Int32 entrytime; | 348 | private Int32 entrytime; |
309 | internal Int32 EntryTime { | 349 | internal Int32 EntryTime |
310 | get { | 350 | { |
311 | return this.entrytime; | 351 | get |
352 | { | ||
353 | return entrytime; | ||
312 | } | 354 | } |
313 | } | 355 | } |
314 | 356 | ||
315 | private UInt64 entryorder; | 357 | private UInt64 entryorder; |
316 | internal UInt64 EntryOrder | 358 | internal UInt64 EntryOrder |
317 | { | 359 | { |
318 | get { | 360 | get |
319 | return this.entryorder; | 361 | { |
362 | return entryorder; | ||
320 | } | 363 | } |
321 | } | 364 | } |
322 | 365 | ||
323 | internal MinHeapItem(uint pqueue, MinHeapItem other) | 366 | internal MinHeapItem(uint _pqueue, MinHeapItem other) |
324 | { | 367 | { |
325 | this.entrytime = other.entrytime; | 368 | entrytime = other.entrytime; |
326 | this.entryorder = other.entryorder; | 369 | entryorder = other.entryorder; |
327 | this.value = other.value; | 370 | value = other.value; |
328 | this.pqueue = pqueue; | 371 | pqueue = _pqueue; |
329 | } | 372 | } |
330 | 373 | ||
331 | internal MinHeapItem(uint pqueue, UInt64 entryorder, EntityUpdate value) | 374 | internal MinHeapItem(uint _pqueue, UInt64 _entryorder, EntityUpdate _value) |
332 | { | 375 | { |
333 | this.entrytime = Util.EnvironmentTickCount(); | 376 | entrytime = Util.EnvironmentTickCount(); |
334 | this.entryorder = entryorder; | 377 | entryorder = _entryorder; |
335 | this.value = value; | 378 | value = _value; |
336 | this.pqueue = pqueue; | 379 | pqueue = _pqueue; |
337 | } | 380 | } |
338 | 381 | ||
339 | public override string ToString() | 382 | public override string ToString() |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 516c1e5..bbaa0e2 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -627,10 +627,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
627 | ImageManager.Close(); | 627 | ImageManager.Close(); |
628 | ImageManager = null; | 628 | ImageManager = null; |
629 | 629 | ||
630 | // m_entityUpdates.Close(); | 630 | m_entityUpdates.Close(); |
631 | // m_entityProps.Close(); | 631 | m_entityProps.Close(); |
632 | m_entityUpdates = new PriorityQueue(1); | ||
633 | m_entityProps = new PriorityQueue(1); | ||
634 | m_killRecord.Clear(); | 632 | m_killRecord.Clear(); |
635 | GroupsInView.Clear(); | 633 | GroupsInView.Clear(); |
636 | 634 | ||
@@ -2683,11 +2681,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2683 | public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) | 2681 | public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks) |
2684 | { | 2682 | { |
2685 | ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); | 2683 | ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect); |
2686 | packet.Header.Reliable = false; | ||
2687 | packet.Header.Zerocoded = true; | ||
2688 | 2684 | ||
2689 | packet.AgentData.AgentID = AgentId; | 2685 | // packet.AgentData.AgentID = AgentId; |
2690 | packet.AgentData.SessionID = SessionId; | 2686 | // packet.AgentData.SessionID = SessionId; |
2691 | 2687 | ||
2692 | packet.Effect = effectBlocks; | 2688 | packet.Effect = effectBlocks; |
2693 | 2689 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 53ca849..cc4df17 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -33,27 +33,12 @@ using OpenSim.Framework; | |||
33 | using OpenMetaverse; | 33 | using OpenMetaverse; |
34 | using OpenSim.Region.PhysicsModules.SharedBase; | 34 | using OpenSim.Region.PhysicsModules.SharedBase; |
35 | 35 | ||
36 | /* | ||
37 | * Steps to add a new prioritization policy: | ||
38 | * | ||
39 | * - Add a new value to the UpdatePrioritizationSchemes enum. | ||
40 | * - Specify this new value in the [InterestManagement] section of your | ||
41 | * OpenSim.ini. The name in the config file must match the enum value name | ||
42 | * (although it is not case sensitive). | ||
43 | * - Write a new GetPriorityBy*() method in this class. | ||
44 | * - Add a new entry to the switch statement in GetUpdatePriority() that calls | ||
45 | * your method. | ||
46 | */ | ||
47 | |||
48 | namespace OpenSim.Region.Framework.Scenes | 36 | namespace OpenSim.Region.Framework.Scenes |
49 | { | 37 | { |
50 | public enum UpdatePrioritizationSchemes | 38 | public enum UpdatePrioritizationSchemes |
51 | { | 39 | { |
52 | Time = 0, | 40 | SimpleAngularDistance = 0, |
53 | Distance = 1, | 41 | BestAvatarResponsiveness = 1, |
54 | SimpleAngularDistance = 2, | ||
55 | FrontBack = 3, | ||
56 | BestAvatarResponsiveness = 4, | ||
57 | } | 42 | } |
58 | 43 | ||
59 | public class Prioritizer | 44 | public class Prioritizer |
@@ -68,14 +53,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
68 | } | 53 | } |
69 | 54 | ||
70 | /// <summary> | 55 | /// <summary> |
71 | /// Returns the priority queue into which the update should be placed. Updates within a | 56 | /// Returns the priority queue into which the update should be placed. |
72 | /// queue will be processed in arrival order. There are currently 12 priority queues | ||
73 | /// implemented in PriorityQueue class in LLClientView. Queue 0 is generally retained | ||
74 | /// for avatar updates. The fair queuing discipline for processing the priority queues | ||
75 | /// assumes that the number of entities in each priority queues increases exponentially. | ||
76 | /// So for example... if queue 1 contains all updates within 10m of the avatar or camera | ||
77 | /// then queue 2 at 20m is about 3X bigger in space & about 3X bigger in total number | ||
78 | /// of updates. | ||
79 | /// </summary> | 57 | /// </summary> |
80 | public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity) | 58 | public uint GetUpdatePriority(IClientAPI client, ISceneEntity entity) |
81 | { | 59 | { |
@@ -94,22 +72,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
94 | 72 | ||
95 | switch (m_scene.UpdatePrioritizationScheme) | 73 | switch (m_scene.UpdatePrioritizationScheme) |
96 | { | 74 | { |
97 | /* | ||
98 | case UpdatePrioritizationSchemes.Time: | ||
99 | priority = GetPriorityByTime(client, entity); | ||
100 | break; | ||
101 | case UpdatePrioritizationSchemes.Distance: | ||
102 | priority = GetPriorityByDistance(client, entity); | ||
103 | break; | ||
104 | case UpdatePrioritizationSchemes.SimpleAngularDistance: | ||
105 | priority = GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance | ||
106 | break; | ||
107 | case UpdatePrioritizationSchemes.FrontBack: | ||
108 | priority = GetPriorityByFrontBack(client, entity); | ||
109 | break; | ||
110 | */ | ||
111 | case UpdatePrioritizationSchemes.SimpleAngularDistance: | 75 | case UpdatePrioritizationSchemes.SimpleAngularDistance: |
112 | priority = GetPriorityByAngularDistance(client, entity); // TODO: Reimplement SimpleAngularDistance | 76 | priority = GetPriorityByAngularDistance(client, entity); |
113 | break; | 77 | break; |
114 | case UpdatePrioritizationSchemes.BestAvatarResponsiveness: | 78 | case UpdatePrioritizationSchemes.BestAvatarResponsiveness: |
115 | default: | 79 | default: |
@@ -120,45 +84,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
120 | return priority; | 84 | return priority; |
121 | } | 85 | } |
122 | 86 | ||
123 | private uint GetPriorityByTime(IClientAPI client, ISceneEntity entity) | ||
124 | { | ||
125 | // And anything attached to this avatar gets top priority as well | ||
126 | if (entity is SceneObjectPart) | ||
127 | { | ||
128 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
129 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
130 | return 1; | ||
131 | } | ||
132 | |||
133 | return PriorityQueue.NumberOfImmediateQueues; // first queue past the immediate queues | ||
134 | } | ||
135 | |||
136 | private uint GetPriorityByDistance(IClientAPI client, ISceneEntity entity) | ||
137 | { | ||
138 | // And anything attached to this avatar gets top priority as well | ||
139 | if (entity is SceneObjectPart) | ||
140 | { | ||
141 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
142 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
143 | return 1; | ||
144 | } | ||
145 | |||
146 | return ComputeDistancePriority(client,entity,false); | ||
147 | } | ||
148 | |||
149 | private uint GetPriorityByFrontBack(IClientAPI client, ISceneEntity entity) | ||
150 | { | ||
151 | // And anything attached to this avatar gets top priority as well | ||
152 | if (entity is SceneObjectPart) | ||
153 | { | ||
154 | SceneObjectPart sop = (SceneObjectPart)entity; | ||
155 | if (sop.ParentGroup.IsAttachment && client.AgentId == sop.ParentGroup.AttachedAvatar) | ||
156 | return 1; | ||
157 | } | ||
158 | |||
159 | return ComputeDistancePriority(client,entity,true); | ||
160 | } | ||
161 | |||
162 | private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) | 87 | private uint GetPriorityByBestAvatarResponsiveness(IClientAPI client, ISceneEntity entity) |
163 | { | 88 | { |
164 | uint pqueue = 2; // keep compiler happy | 89 | uint pqueue = 2; // keep compiler happy |
@@ -176,7 +101,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
176 | // Attachments are high priority, | 101 | // Attachments are high priority, |
177 | if (sog.IsAttachment) | 102 | if (sog.IsAttachment) |
178 | return 2; | 103 | return 2; |
179 | |||
180 | 104 | ||
181 | if(presence.ParentPart != null) | 105 | if(presence.ParentPart != null) |
182 | { | 106 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a21b4f7..2e14a20 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1115,7 +1115,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1115 | catch (Exception) | 1115 | catch (Exception) |
1116 | { | 1116 | { |
1117 | m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); | 1117 | m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); |
1118 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.Time; | 1118 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.BestAvatarResponsiveness; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | IsReprioritizationEnabled | 1121 | IsReprioritizationEnabled |
@@ -1196,7 +1196,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1196 | UseBackup = true; | 1196 | UseBackup = true; |
1197 | 1197 | ||
1198 | IsReprioritizationEnabled = true; | 1198 | IsReprioritizationEnabled = true; |
1199 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.Time; | 1199 | UpdatePrioritizationScheme = UpdatePrioritizationSchemes.BestAvatarResponsiveness; |
1200 | ReprioritizationInterval = 5000; | 1200 | ReprioritizationInterval = 5000; |
1201 | 1201 | ||
1202 | ReprioritizationDistance = m_minReprioritizationDistance; | 1202 | ReprioritizationDistance = m_minReprioritizationDistance; |
@@ -1762,7 +1762,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1762 | } | 1762 | } |
1763 | 1763 | ||
1764 | m_sceneGridService.InformNeighborsThatRegionisUp( | 1764 | m_sceneGridService.InformNeighborsThatRegionisUp( |
1765 | RequestModuleInterface<INeighbourService>(), RegionInfo); | 1765 | RequestModuleInterface<INeighbourService>(), RegionInfo); |
1766 | 1766 | ||
1767 | // Region ready should always be set | 1767 | // Region ready should always be set |
1768 | Ready = true; | 1768 | Ready = true; |