diff options
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 2229421..b37a51b 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -95,7 +95,9 @@ namespace OpenSim.Services.GridService | |||
95 | if (region != null) | 95 | if (region != null) |
96 | { | 96 | { |
97 | // Not really? Maybe? | 97 | // Not really? Maybe? |
98 | List<RegionData> rdatas = m_Database.Get(region.posX - 1, region.posY - 1, region.posX + 1, region.posY + 1, scopeID); | 98 | List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize, region.posY - (int)Constants.RegionSize, |
99 | region.posX + (int)Constants.RegionSize, region.posY + (int)Constants.RegionSize, scopeID); | ||
100 | |||
99 | foreach (RegionData rdata in rdatas) | 101 | foreach (RegionData rdata in rdatas) |
100 | rinfos.Add(RegionData2RegionInfo(rdata)); | 102 | rinfos.Add(RegionData2RegionInfo(rdata)); |
101 | 103 | ||
@@ -114,7 +116,9 @@ namespace OpenSim.Services.GridService | |||
114 | 116 | ||
115 | public SimpleRegionInfo GetRegionByPosition(UUID scopeID, int x, int y) | 117 | public SimpleRegionInfo GetRegionByPosition(UUID scopeID, int x, int y) |
116 | { | 118 | { |
117 | RegionData rdata = m_Database.Get(x, y, scopeID); | 119 | int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize; |
120 | int snapY = (int)(y / Constants.RegionSize) * (int)Constants.RegionSize; | ||
121 | RegionData rdata = m_Database.Get(snapX, snapY, scopeID); | ||
118 | if (rdata != null) | 122 | if (rdata != null) |
119 | return RegionData2RegionInfo(rdata); | 123 | return RegionData2RegionInfo(rdata); |
120 | 124 | ||
@@ -151,7 +155,12 @@ namespace OpenSim.Services.GridService | |||
151 | 155 | ||
152 | public List<SimpleRegionInfo> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) | 156 | public List<SimpleRegionInfo> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) |
153 | { | 157 | { |
154 | List<RegionData> rdatas = m_Database.Get(xmin, ymin, xmax, ymax, scopeID); | 158 | int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; |
159 | int xmaxSnap = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize; | ||
160 | int yminSnap = (int)(ymin / Constants.RegionSize) * (int)Constants.RegionSize; | ||
161 | int ymaxSnap = (int)(ymax / Constants.RegionSize) * (int)Constants.RegionSize; | ||
162 | |||
163 | List<RegionData> rdatas = m_Database.Get(xminSnap, yminSnap, xmaxSnap, ymaxSnap, scopeID); | ||
155 | List<SimpleRegionInfo> rinfos = new List<SimpleRegionInfo>(); | 164 | List<SimpleRegionInfo> rinfos = new List<SimpleRegionInfo>(); |
156 | foreach (RegionData rdata in rdatas) | 165 | foreach (RegionData rdata in rdatas) |
157 | rinfos.Add(RegionData2RegionInfo(rdata)); | 166 | rinfos.Add(RegionData2RegionInfo(rdata)); |
@@ -170,7 +179,7 @@ namespace OpenSim.Services.GridService | |||
170 | rdata.posY = (int)rinfo.RegionLocY; | 179 | rdata.posY = (int)rinfo.RegionLocY; |
171 | rdata.RegionID = rinfo.RegionID; | 180 | rdata.RegionID = rinfo.RegionID; |
172 | rdata.Data = rinfo.ToKeyValuePairs(); | 181 | rdata.Data = rinfo.ToKeyValuePairs(); |
173 | //rdata.RegionName = rinfo.RegionName; | 182 | rdata.RegionName = rinfo.RegionName; |
174 | 183 | ||
175 | return rdata; | 184 | return rdata; |
176 | } | 185 | } |
@@ -181,7 +190,7 @@ namespace OpenSim.Services.GridService | |||
181 | rinfo.RegionLocX = (uint)rdata.posX; | 190 | rinfo.RegionLocX = (uint)rdata.posX; |
182 | rinfo.RegionLocY = (uint)rdata.posY; | 191 | rinfo.RegionLocY = (uint)rdata.posY; |
183 | rinfo.RegionID = rdata.RegionID; | 192 | rinfo.RegionID = rdata.RegionID; |
184 | //rinfo.RegionName = rdata.RegionName; | 193 | rinfo.RegionName = rdata.RegionName; |
185 | 194 | ||
186 | return rinfo; | 195 | return rinfo; |
187 | } | 196 | } |