aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors/Grid/GridServicesConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/Grid/GridServicesConnector.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
index 596f867..6c6ccf9 100644
--- a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs
@@ -49,6 +49,9 @@ namespace OpenSim.Services.Connectors
49 49
50 private string m_ServerURI = String.Empty; 50 private string m_ServerURI = String.Empty;
51 51
52 private ExpiringCache<ulong, GridRegion> m_regionCache =
53 new ExpiringCache<ulong, GridRegion>();
54
52 public GridServicesConnector() 55 public GridServicesConnector()
53 { 56 {
54 } 57 }
@@ -275,6 +278,11 @@ namespace OpenSim.Services.Connectors
275 278
276 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 279 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
277 { 280 {
281 ulong regionHandle = Util.UIntsToLong((uint)x, (uint)y);
282
283 if (m_regionCache.Contains(regionHandle))
284 return (GridRegion)m_regionCache[regionHandle];
285
278 Dictionary<string, object> sendData = new Dictionary<string, object>(); 286 Dictionary<string, object> sendData = new Dictionary<string, object>();
279 287
280 sendData["SCOPEID"] = scopeID.ToString(); 288 sendData["SCOPEID"] = scopeID.ToString();
@@ -316,6 +324,8 @@ namespace OpenSim.Services.Connectors
316 else 324 else
317 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply"); 325 m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply");
318 326
327 m_regionCache.Add(regionHandle, rinfo, TimeSpan.FromSeconds(600));
328
319 return rinfo; 329 return rinfo;
320 } 330 }
321 331