diff options
author | Mic Bowman | 2011-08-05 11:13:02 -0700 |
---|---|---|
committer | Mic Bowman | 2011-08-05 11:13:02 -0700 |
commit | c3f579046c4de7a5a65e71e4c02958425fd7998a (patch) | |
tree | b725d9eaa66d5eb7cf1f87ddbb4fa0f4284f71f5 /OpenSim/Services/GridService | |
parent | BulletSim: Parameters settable from ini file. Linksets. Physical property val... (diff) | |
parent | remove the largely unused copy/pasted HandleAgentRequestSit() method (diff) | |
download | opensim-SC_OLD-c3f579046c4de7a5a65e71e4c02958425fd7998a.zip opensim-SC_OLD-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.gz opensim-SC_OLD-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.bz2 opensim-SC_OLD-c3f579046c4de7a5a65e71e4c02958425fd7998a.tar.xz |
Merge branch 'master' into bulletsim
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 33 |
1 files changed, 27 insertions, 6 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 985d77b..f663dd6 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -320,18 +320,25 @@ namespace OpenSim.Services.GridService | |||
320 | return null; | 320 | return null; |
321 | } | 321 | } |
322 | 322 | ||
323 | public GridRegion GetRegionByName(UUID scopeID, string regionName) | 323 | public GridRegion GetRegionByName(UUID scopeID, string name) |
324 | { | 324 | { |
325 | List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID); | 325 | List<RegionData> rdatas = m_Database.Get(name, scopeID); |
326 | if ((rdatas != null) && (rdatas.Count > 0)) | 326 | if ((rdatas != null) && (rdatas.Count > 0)) |
327 | return RegionData2RegionInfo(rdatas[0]); // get the first | 327 | return RegionData2RegionInfo(rdatas[0]); // get the first |
328 | 328 | ||
329 | if (m_AllowHypergridMapSearch) | ||
330 | { | ||
331 | GridRegion r = GetHypergridRegionByName(scopeID, name); | ||
332 | if (r != null) | ||
333 | return r; | ||
334 | } | ||
335 | |||
329 | return null; | 336 | return null; |
330 | } | 337 | } |
331 | 338 | ||
332 | public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) | 339 | public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) |
333 | { | 340 | { |
334 | m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); | 341 | // m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); |
335 | 342 | ||
336 | List<RegionData> rdatas = m_Database.Get(name + "%", scopeID); | 343 | List<RegionData> rdatas = m_Database.Get(name + "%", scopeID); |
337 | 344 | ||
@@ -340,7 +347,7 @@ namespace OpenSim.Services.GridService | |||
340 | 347 | ||
341 | if (rdatas != null) | 348 | if (rdatas != null) |
342 | { | 349 | { |
343 | m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); | 350 | // m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); |
344 | foreach (RegionData rdata in rdatas) | 351 | foreach (RegionData rdata in rdatas) |
345 | { | 352 | { |
346 | if (count++ < maxNumber) | 353 | if (count++ < maxNumber) |
@@ -348,9 +355,9 @@ namespace OpenSim.Services.GridService | |||
348 | } | 355 | } |
349 | } | 356 | } |
350 | 357 | ||
351 | if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)) && name.Contains(".")) | 358 | if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0))) |
352 | { | 359 | { |
353 | GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name); | 360 | GridRegion r = GetHypergridRegionByName(scopeID, name); |
354 | if (r != null) | 361 | if (r != null) |
355 | rinfos.Add(r); | 362 | rinfos.Add(r); |
356 | } | 363 | } |
@@ -358,6 +365,20 @@ namespace OpenSim.Services.GridService | |||
358 | return rinfos; | 365 | return rinfos; |
359 | } | 366 | } |
360 | 367 | ||
368 | /// <summary> | ||
369 | /// Get a hypergrid region. | ||
370 | /// </summary> | ||
371 | /// <param name="scopeID"></param> | ||
372 | /// <param name="name"></param> | ||
373 | /// <returns>null if no hypergrid region could be found.</returns> | ||
374 | protected GridRegion GetHypergridRegionByName(UUID scopeID, string name) | ||
375 | { | ||
376 | if (name.Contains(".")) | ||
377 | return m_HypergridLinker.LinkRegion(scopeID, name); | ||
378 | else | ||
379 | return null; | ||
380 | } | ||
381 | |||
361 | public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) | 382 | public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) |
362 | { | 383 | { |
363 | int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; | 384 | int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize; |