From 8d33a2eaa10ed75146f45cca4d6c19ac814d5fee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 2 Aug 2011 00:26:17 +0100 Subject: 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() --- OpenSim/Services/GridService/GridService.cs | 9 +++++---- 1 file 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 public GridRegion GetRegionByName(UUID scopeID, string regionName) { - List rdatas = m_Database.Get(regionName + "%", scopeID); - if ((rdatas != null) && (rdatas.Count > 0)) - return RegionData2RegionInfo(rdatas[0]); // get the first + List rinfos = GetRegionsByName(scopeID, regionName, 1); + + if (rinfos.Count > 0) + return rinfos[0]; return null; } public List GetRegionsByName(UUID scopeID, string name, int maxNumber) { - m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); +// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name); List rdatas = m_Database.Get(name + "%", scopeID); -- cgit v1.1