aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
diff options
context:
space:
mode:
authorMelanie2009-10-06 17:44:59 +0100
committerMelanie2009-10-06 17:44:59 +0100
commit0374f1b144f3faf35da39e3925e8abd4b2a8bd04 (patch)
tree456d3d532c70d32564d35fc3cb9bbc81bdf08b2e /OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
parentMake sure that keys exist in arrays before trying to access them. (diff)
parentCorrected words in error message. (diff)
downloadopensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.zip
opensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.tar.gz
opensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.tar.bz2
opensim-SC_OLD-0374f1b144f3faf35da39e3925e8abd4b2a8bd04.tar.xz
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs14
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
index 2b336bb..44e850b 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
@@ -29,10 +29,12 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31 31
32using OpenSim.Framework;
32using OpenSim.Region.Framework.Scenes; 33using OpenSim.Region.Framework.Scenes;
33using OpenSim.Services.Interfaces; 34using OpenSim.Services.Interfaces;
34using GridRegion = OpenSim.Services.Interfaces.GridRegion; 35using GridRegion = OpenSim.Services.Interfaces.GridRegion;
35 36
37using OpenMetaverse;
36using log4net; 38using log4net;
37 39
38namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid 40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
@@ -75,5 +77,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
75 { 77 {
76 return new List<GridRegion>(m_neighbours.Values); 78 return new List<GridRegion>(m_neighbours.Values);
77 } 79 }
80
81 public GridRegion GetRegionByPosition(int x, int y)
82 {
83 uint xsnap = (uint)(x / Constants.RegionSize) * Constants.RegionSize;
84 uint ysnap = (uint)(y / Constants.RegionSize) * Constants.RegionSize;
85 ulong handle = Utils.UIntsToLong(xsnap, ysnap);
86
87 if (m_neighbours.ContainsKey(handle))
88 return m_neighbours[handle];
89
90 return null;
91 }
78 } 92 }
79} 93}