From 95f43ab73ebac860cbcd534f07d60404f257b0bb Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 24 Feb 2012 18:17:30 +0100 Subject: [PATCH 1/2] Add a cache on GridService requests --- .../Services/Connectors/Grid/GridServiceConnector.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index 1599a56b1b..7deaf954c0 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs @@ -48,6 +48,9 @@ namespace OpenSim.Services.Connectors private string m_ServerURI = String.Empty; + private ExpiringCache m_regionCache = + new ExpiringCache(); + public GridServicesConnector() { } @@ -265,6 +268,11 @@ namespace OpenSim.Services.Connectors public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) { + ulong regionHandle = Util.UIntsToLong((uint)x, (uint)y); + + if (m_regionCache.Contains(regionHandle)) + return (GridRegion)m_regionCache[regionHandle]; + Dictionary sendData = new Dictionary(); sendData["SCOPEID"] = scopeID.ToString(); @@ -306,6 +314,8 @@ namespace OpenSim.Services.Connectors else m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply"); + m_regionCache.Add(regionHandle, rinfo, TimeSpan.FromSeconds(600)); + return rinfo; } From 991826ca76a80f8a1e03ce63d759185fddd5da4f Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 24 Feb 2012 19:31:27 +0100 Subject: [PATCH 2/2] Try not to send the avatar updates on login. This may mean loggin in with invisible attachments again but could help the appearance issues. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 26fa6c0bfa..01053bf250 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1000,7 +1000,8 @@ namespace OpenSim.Region.Framework.Scenes } } - SendAvatarDataToAllAgents(); + if (wasChild) + SendAvatarDataToAllAgents(); // send the animations of the other presences to me m_scene.ForEachRootScenePresence(delegate(ScenePresence presence)