mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 09:16:28 +08:00
a few changes
This commit is contained in:
@@ -513,6 +513,17 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public string RegionHostPortSpaceName
|
||||
{
|
||||
get
|
||||
{
|
||||
string ret = (Flags & URIFlags.HasHost) != 0 ? (Host + ":" + Port + "/ ") : ""; // space needed for compatibility
|
||||
if ((Flags & URIFlags.HasRegionName) != 0)
|
||||
ret += RegionName;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
// this needs to be set before get
|
||||
public bool IsLocalGrid
|
||||
{
|
||||
|
||||
@@ -358,7 +358,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
return rinfo;
|
||||
|
||||
List<GridRegion> grinfo = null;
|
||||
if (!uri.HasRegionName)
|
||||
if (!uri.HasRegionName && (rinfo == null || rinfo.Count == 0))
|
||||
{
|
||||
List<GridRegion> grinfos = m_RemoteGridService.GetDefaultRegions(scopeID);
|
||||
if (grinfos == null || grinfos.Count == 0)
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
if (mapName.Length < 3 || (mapName.EndsWith("#") && mapName.Length < 4))
|
||||
{
|
||||
// final block, closing the search result
|
||||
AddFinalBlock(blocks,mapName);
|
||||
AddFinalBlock(blocks, mapName);
|
||||
|
||||
// flags are agent flags sent from the viewer.
|
||||
// they have different values depending on different viewers, apparently
|
||||
@@ -171,14 +171,14 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
MapBlockData block = new MapBlockData();
|
||||
WorldMap.MapBlockFromGridRegion(block, info, flags);
|
||||
|
||||
if (flags == 2 && regionInfos.Count == 1 && needOriginalName)
|
||||
block.Name = mapNameOrig;
|
||||
if (needOriginalName && flags == 2 && regionInfos.Count == 1)
|
||||
block.Name = mapNameOrig;
|
||||
blocks.Add(block);
|
||||
}
|
||||
}
|
||||
|
||||
// final block, closing the search result
|
||||
AddFinalBlock(blocks,mapNameOrig);
|
||||
AddFinalBlock(blocks, mapNameOrig);
|
||||
|
||||
// flags are agent flags sent from the viewer.
|
||||
// they have different values depending on different viewers, apparently
|
||||
|
||||
@@ -561,21 +561,25 @@ namespace OpenSim.Services.GridService
|
||||
if (!nameURI.IsValid)
|
||||
return new List<GridRegion>();
|
||||
|
||||
List<RegionData> rdatas = m_Database.Get("%" + Util.EscapeForLike(nameURI.RegionUrlAndName) + "%", scopeID);
|
||||
|
||||
int count = 0;
|
||||
|
||||
string mapname = nameURI.RegionHostPortSpaceName;
|
||||
List<RegionData> rdatas = m_Database.Get("%" + Util.EscapeForLike(mapname) + "%", scopeID);
|
||||
List<GridRegion> rinfos = new List<GridRegion>();
|
||||
|
||||
if (m_AllowHypergridMapSearch && nameURI.HasHost)
|
||||
{
|
||||
string mapname = nameURI.RegionUrlAndName;
|
||||
bool haveMatch = false;
|
||||
if (rdatas != null && (rdatas.Count > 0))
|
||||
{
|
||||
bool haveMatch = false;
|
||||
// m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
foreach (RegionData rdata in rdatas)
|
||||
{
|
||||
if (mapname.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
int indx = rdata.RegionName.IndexOf("://");
|
||||
if(indx < 0)
|
||||
continue;
|
||||
string rname = rdata.RegionName.Substring(indx + 3);
|
||||
if (mapname.Equals(rname, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
haveMatch = true;
|
||||
rinfos.Insert(0, RegionData2RegionInfo(rdata));
|
||||
@@ -597,20 +601,32 @@ namespace OpenSim.Services.GridService
|
||||
rinfos.Add(r);
|
||||
}
|
||||
}
|
||||
else if (rdatas != null && (rdatas.Count > 0))
|
||||
else
|
||||
{
|
||||
string name = nameURI.RegionName;
|
||||
//m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
foreach (RegionData rdata in rdatas)
|
||||
if (!nameURI.HasRegionName)
|
||||
{
|
||||
if (name.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
List<GridRegion> dinfos = GetDefaultRegions(scopeID);
|
||||
if(dinfos != null && dinfos.Count >0)
|
||||
rinfos.Add(dinfos[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
string name = nameURI.RegionName;
|
||||
if (rdatas != null && (rdatas.Count > 0))
|
||||
{
|
||||
rinfos.Insert(0, RegionData2RegionInfo(rdata));
|
||||
if (count == maxNumber)
|
||||
rinfos.RemoveAt(count - 1);
|
||||
//m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count);
|
||||
foreach (RegionData rdata in rdatas)
|
||||
{
|
||||
if (name.Equals(rdata.RegionName, StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
rinfos.Insert(0, RegionData2RegionInfo(rdata));
|
||||
if (count == maxNumber)
|
||||
rinfos.RemoveAt(count - 1);
|
||||
}
|
||||
else if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
}
|
||||
}
|
||||
else if (count++ < maxNumber)
|
||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||
}
|
||||
}
|
||||
return rinfos;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user