aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService/GridService.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-02 00:26:17 +0100
committerJustin Clark-Casey (justincc)2011-08-02 00:26:17 +0100
commit8d33a2eaa10ed75146f45cca4d6c19ac814d5fee (patch)
treebaf669129622f2b676a0ac79059db983e3544cfb /OpenSim/Services/GridService/GridService.cs
parentGet rid of AvatarAppearance.Owner to simplify the code. (diff)
downloadopensim-SC_OLD-8d33a2eaa10ed75146f45cca4d6c19ac814d5fee.zip
opensim-SC_OLD-8d33a2eaa10ed75146f45cca4d6c19ac814d5fee.tar.gz
opensim-SC_OLD-8d33a2eaa10ed75146f45cca4d6c19ac814d5fee.tar.bz2
opensim-SC_OLD-8d33a2eaa10ed75146f45cca4d6c19ac814d5fee.tar.xz
In GridService, have GetRegionByName() call GetRegionsByName() with a max return of 1 instead of duplicating code.
This also fixes the problem where this method would not return a hypergrid region, unlike GetRegionsByName()
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r--OpenSim/Services/GridService/GridService.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 985d77b..1253b5a 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -322,16 +322,17 @@ namespace OpenSim.Services.GridService
322 322
323 public GridRegion GetRegionByName(UUID scopeID, string regionName) 323 public GridRegion GetRegionByName(UUID scopeID, string regionName)
324 { 324 {
325 List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID); 325 List<GridRegion> rinfos = GetRegionsByName(scopeID, regionName, 1);
326 if ((rdatas != null) && (rdatas.Count > 0)) 326
327 return RegionData2RegionInfo(rdatas[0]); // get the first 327 if (rinfos.Count > 0)
328 return rinfos[0];
328 329
329 return null; 330 return null;
330 } 331 }
331 332
332 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber) 333 public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
333 { 334 {
334 m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); 335// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
335 336
336 List<RegionData> rdatas = m_Database.Get(name + "%", scopeID); 337 List<RegionData> rdatas = m_Database.Get(name + "%", scopeID);
337 338