diff options
author | onefang | 2019-05-19 21:24:15 +1000 |
---|---|---|
committer | onefang | 2019-05-19 21:24:15 +1000 |
commit | 5e4d6cab00cb29cd088ab7b62ab13aff103b64cb (patch) | |
tree | a9fbc62df9eb2d1d9ba2698d8552eae71eca20d8 /OpenSim/Services/Connectors/Grid | |
parent | Add a build script. (diff) | |
download | opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.zip opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.gz opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.bz2 opensim-SC_OLD-5e4d6cab00cb29cd088ab7b62ab13aff103b64cb.tar.xz |
Dump OpenSim 0.9.0.1 into it's own branch.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/Connectors/Grid/GridServicesConnector.cs | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs b/OpenSim/Services/Connectors/Grid/GridServicesConnector.cs index 596f867..ded7806 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,13 @@ 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 | GridRegion rinfo = null; | ||
282 | ulong regionHandle = Util.UIntsToLong((uint)x, (uint)y); | ||
283 | |||
284 | // this cache includes NULL regions | ||
285 | if (m_regionCache.TryGetValue(regionHandle, out rinfo)) | ||
286 | return rinfo; | ||
287 | |||
278 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 288 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
279 | 289 | ||
280 | sendData["SCOPEID"] = scopeID.ToString(); | 290 | sendData["SCOPEID"] = scopeID.ToString(); |
@@ -296,7 +306,6 @@ namespace OpenSim.Services.Connectors | |||
296 | return null; | 306 | return null; |
297 | } | 307 | } |
298 | 308 | ||
299 | GridRegion rinfo = null; | ||
300 | if (reply != string.Empty) | 309 | if (reply != string.Empty) |
301 | { | 310 | { |
302 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 311 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |
@@ -316,6 +325,8 @@ namespace OpenSim.Services.Connectors | |||
316 | else | 325 | else |
317 | m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply"); | 326 | m_log.DebugFormat("[GRID CONNECTOR]: GetRegionByPosition received null reply"); |
318 | 327 | ||
328 | m_regionCache.Add(regionHandle, rinfo, TimeSpan.FromSeconds(600)); | ||
329 | |||
319 | return rinfo; | 330 | return rinfo; |
320 | } | 331 | } |
321 | 332 | ||
@@ -672,7 +683,7 @@ namespace OpenSim.Services.Connectors | |||
672 | 683 | ||
673 | return rinfos; | 684 | return rinfos; |
674 | } | 685 | } |
675 | 686 | ||
676 | public int GetRegionFlags(UUID scopeID, UUID regionID) | 687 | public int GetRegionFlags(UUID scopeID, UUID regionID) |
677 | { | 688 | { |
678 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 689 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
@@ -744,7 +755,7 @@ namespace OpenSim.Services.Connectors | |||
744 | if (reply != string.Empty) | 755 | if (reply != string.Empty) |
745 | { | 756 | { |
746 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | 757 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); |
747 | 758 | ||
748 | if ((replyData != null) && replyData.Count > 0) | 759 | if ((replyData != null) && replyData.Count > 0) |
749 | { | 760 | { |
750 | foreach (string key in replyData.Keys) | 761 | foreach (string key in replyData.Keys) |