mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
Resolve merge commits, stage 1
This commit is contained in:
@@ -320,18 +320,25 @@ namespace OpenSim.Services.GridService
|
||||
return null;
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByName(UUID scopeID, string regionName)
|
||||
public GridRegion GetRegionByName(UUID scopeID, string name)
|
||||
{
|
||||
List<RegionData> rdatas = m_Database.Get(regionName + "%", scopeID);
|
||||
List<RegionData> rdatas = m_Database.Get(name, scopeID);
|
||||
if ((rdatas != null) && (rdatas.Count > 0))
|
||||
return RegionData2RegionInfo(rdatas[0]); // get the first
|
||||
|
||||
if (m_AllowHypergridMapSearch)
|
||||
{
|
||||
GridRegion r = GetHypergridRegionByName(scopeID, name);
|
||||
if (r != null)
|
||||
return r;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
{
|
||||
m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
|
||||
// m_log.DebugFormat("[GRID SERVICE]: GetRegionsByName {0}", name);
|
||||
|
||||
List<RegionData> rdatas = m_Database.Get(name + "%", scopeID);
|
||||
|
||||
@@ -340,7 +347,7 @@ namespace OpenSim.Services.GridService
|
||||
|
||||
if (rdatas != null)
|
||||
{
|
||||
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)
|
||||
@@ -348,9 +355,9 @@ namespace OpenSim.Services.GridService
|
||||
}
|
||||
}
|
||||
|
||||
if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)) && name.Contains("."))
|
||||
if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)))
|
||||
{
|
||||
GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name);
|
||||
GridRegion r = GetHypergridRegionByName(scopeID, name);
|
||||
if (r != null)
|
||||
rinfos.Add(r);
|
||||
}
|
||||
@@ -358,6 +365,20 @@ namespace OpenSim.Services.GridService
|
||||
return rinfos;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a hypergrid region.
|
||||
/// </summary>
|
||||
/// <param name="scopeID"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <returns>null if no hypergrid region could be found.</returns>
|
||||
protected GridRegion GetHypergridRegionByName(UUID scopeID, string name)
|
||||
{
|
||||
if (name.Contains("."))
|
||||
return m_HypergridLinker.LinkRegion(scopeID, name);
|
||||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
|
||||
{
|
||||
int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
|
||||
@@ -489,8 +510,9 @@ namespace OpenSim.Services.GridService
|
||||
OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);
|
||||
MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} {5}\n\n",
|
||||
r.RegionName, r.RegionID,
|
||||
String.Format("{0},{1}", r.posX, r.posY), r.Data["serverURI"],
|
||||
r.Data["owner_uuid"].ToString(), flags.ToString()));
|
||||
String.Format("{0},{1}", r.posX / Constants.RegionSize, r.posY / Constants.RegionSize),
|
||||
r.Data["serverURI"],
|
||||
r.Data["owner_uuid"], flags));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user