aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-29 23:36:37 +0000
committerTeravus Ovares2008-05-29 23:36:37 +0000
commit9cefda83d6d54edc9ed1587bb71e9cb8fb2d17d5 (patch)
treec0ae17b8dac06e2616532fea2ac4e2bfcb59f4b6 /OpenSim/Region/Environment
parent* Fixes a few taper/top-sheer situations that were previously having issues. (diff)
downloadopensim-SC_OLD-9cefda83d6d54edc9ed1587bb71e9cb8fb2d17d5.zip
opensim-SC_OLD-9cefda83d6d54edc9ed1587bb71e9cb8fb2d17d5.tar.gz
opensim-SC_OLD-9cefda83d6d54edc9ed1587bb71e9cb8fb2d17d5.tar.bz2
opensim-SC_OLD-9cefda83d6d54edc9ed1587bb71e9cb8fb2d17d5.tar.xz
* Caches UUIDName requests
* Looks up UUIDNames for script time and colliders in a separate thread. * Hopefully this'll allow you to look at top scripts on a region that has a lot of scripts without crashing your client thread.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs48
1 files changed, 46 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
index ab5898d..6c63c36 100644
--- a/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Estate/EstateManagementModule.cs
@@ -24,7 +24,8 @@
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27using System;
28using System.Threading;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
30using libsecondlife; 31using libsecondlife;
@@ -40,6 +41,8 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
40 { 41 {
41 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 42 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
42 43
44 private delegate void LookupUUIDS(List<LLUUID> uuidLst);
45
43 private Scene m_scene; 46 private Scene m_scene;
44 47
45 #region Packet Data Responders 48 #region Packet Data Responders
@@ -314,6 +317,7 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
314 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient) 317 private void HandleLandStatRequest(int parcelID, uint reportType, uint requestFlags, string filter, IClientAPI remoteClient)
315 { 318 {
316 Dictionary<uint, float> SceneData = new Dictionary<uint,float>(); 319 Dictionary<uint, float> SceneData = new Dictionary<uint,float>();
320 List<LLUUID> uuidNameLookupList = new List<LLUUID>();
317 321
318 if (reportType == 1) 322 if (reportType == 1)
319 { 323 {
@@ -345,7 +349,17 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
345 lsri.TaskID = sog.UUID; 349 lsri.TaskID = sog.UUID;
346 lsri.TaskLocalID = sog.LocalId; 350 lsri.TaskLocalID = sog.LocalId;
347 lsri.TaskName = sog.GetPartName(obj); 351 lsri.TaskName = sog.GetPartName(obj);
348 lsri.OwnerName = m_scene.CommsManager.UUIDNameRequestString(sog.OwnerID); 352 if (m_scene.CommsManager.UUIDNameCachedTest(sog.OwnerID))
353 {
354 lsri.OwnerName = m_scene.CommsManager.UUIDNameRequestString(sog.OwnerID);
355 }
356 else
357 {
358 lsri.OwnerName = "waiting";
359 lock(uuidNameLookupList)
360 uuidNameLookupList.Add(sog.OwnerID);
361 }
362
349 if (filter.Length != 0) 363 if (filter.Length != 0)
350 { 364 {
351 if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter))) 365 if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter)))
@@ -365,9 +379,39 @@ namespace OpenSim.Region.Environment.Modules.World.Estate
365 } 379 }
366 } 380 }
367 remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray()); 381 remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray());
382
383 if (uuidNameLookupList.Count > 0)
384 LookupUUID(uuidNameLookupList);
385 }
386
387 private void LookupUUIDSCompleted(IAsyncResult iar)
388 {
389 LookupUUIDS icon = (LookupUUIDS)iar.AsyncState;
390 icon.EndInvoke(iar);
391 }
392 private void LookupUUID(List<LLUUID> uuidLst)
393 {
394 LookupUUIDS d = LookupUUIDsAsync;
368 395
396 d.BeginInvoke(uuidLst,
397 LookupUUIDSCompleted,
398 d);
369 } 399 }
400 private void LookupUUIDsAsync(List<LLUUID> uuidLst)
401 {
402 LLUUID[] uuidarr = new LLUUID[0];
403
404 lock (uuidLst)
405 {
406 uuidarr = uuidLst.ToArray();
407 }
370 408
409 for (int i = 0; i < uuidarr.Length; i++)
410 {
411 string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
412 // we drop it. It gets cached though... so we're ready for the next request.
413 }
414 }
371 #endregion 415 #endregion
372 416
373 #region Outgoing Packets 417 #region Outgoing Packets