mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 02:05:34 +08:00
work on previus 2 patchs
This commit is contained in:
@@ -476,9 +476,9 @@ namespace OpenSim.Services.GridService
|
||||
|
||||
public GridRegion GetRegionByName(UUID scopeID, string name)
|
||||
{
|
||||
List<RegionData> rdatas = m_Database.Get(Util.EscapeForLike(name), scopeID);
|
||||
if ((rdatas != null) && (rdatas.Count > 0))
|
||||
return RegionData2RegionInfo(rdatas[0]); // get the first
|
||||
RegionData rdata = m_Database.GetSpecific(name, scopeID);
|
||||
if (rdata != null)
|
||||
return RegionData2RegionInfo(rdata);
|
||||
|
||||
if (m_AllowHypergridMapSearch)
|
||||
{
|
||||
@@ -490,18 +490,7 @@ namespace OpenSim.Services.GridService
|
||||
return null;
|
||||
}
|
||||
|
||||
//BA MOD....
|
||||
public GridRegion GetRegionByNameSpecific(UUID scopeID, string name)
|
||||
{
|
||||
RegionData rdata = m_Database.GetSpecific(name, scopeID);
|
||||
if (rdata != null)
|
||||
{
|
||||
return RegionData2RegionInfo(rdata);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
{
|
||||
// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
|
||||
|
||||
@@ -510,7 +499,7 @@ namespace OpenSim.Services.GridService
|
||||
int count = 0;
|
||||
List<GridRegion> rinfos = new List<GridRegion>();
|
||||
|
||||
if (count < maxNumber && m_AllowHypergridMapSearch && name.Contains("."))
|
||||
if (m_AllowHypergridMapSearch && name.Contains("."))
|
||||
{
|
||||
string regionURI = "";
|
||||
string regionHost = "";
|
||||
@@ -538,7 +527,7 @@ namespace OpenSim.Services.GridService
|
||||
{
|
||||
if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
if(rdata.RegionName == mapname)
|
||||
if(mapname.Equals(rdata.RegionName,StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
haveMatch = true;
|
||||
if(count == maxNumber)
|
||||
@@ -560,7 +549,7 @@ namespace OpenSim.Services.GridService
|
||||
{
|
||||
if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
if(rdata.RegionName == mapname)
|
||||
if (mapname.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
haveMatch = true;
|
||||
if(count == maxNumber)
|
||||
@@ -588,11 +577,20 @@ namespace OpenSim.Services.GridService
|
||||
}
|
||||
else if (rdatas != null && (rdatas.Count > 0))
|
||||
{
|
||||
// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
//m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
foreach (RegionData rdata in rdatas)
|
||||
{
|
||||
if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
if (name.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
if (count == maxNumber)
|
||||
{
|
||||
rinfos.RemoveAt(count - 1);
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user