Fixes mantis #5270 -- Map tiles for hyperlinks not showing in world map for grided sims.
parent
e47cc10674
commit
55e04e6c68
|
@ -41,8 +41,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
|||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
{
|
||||
public class RemoteGridServicesConnector :
|
||||
GridServicesConnector, ISharedRegionModule, IGridService
|
||||
public class RemoteGridServicesConnector : ISharedRegionModule, IGridService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
|
@ -51,6 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
private bool m_Enabled = false;
|
||||
|
||||
private IGridService m_LocalGridService;
|
||||
private IGridService m_RemoteGridService;
|
||||
|
||||
public RemoteGridServicesConnector()
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
get { return "RemoteGridServicesConnector"; }
|
||||
}
|
||||
|
||||
public override void Initialise(IConfigSource source)
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig moduleConfig = source.Configs["Modules"];
|
||||
if (moduleConfig != null)
|
||||
|
@ -97,9 +97,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
return;
|
||||
}
|
||||
|
||||
base.Initialise(source);
|
||||
|
||||
m_LocalGridService = new LocalGridServicesConnector(source);
|
||||
m_RemoteGridService = new GridServicesConnector(source);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
|
@ -135,61 +134,61 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
|
||||
#region IGridService
|
||||
|
||||
public override string RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
public string RegisterRegion(UUID scopeID, GridRegion regionInfo)
|
||||
{
|
||||
string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo);
|
||||
|
||||
if (msg == String.Empty)
|
||||
return base.RegisterRegion(scopeID, regionInfo);
|
||||
return m_RemoteGridService.RegisterRegion(scopeID, regionInfo);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
public override bool DeregisterRegion(UUID regionID)
|
||||
public bool DeregisterRegion(UUID regionID)
|
||||
{
|
||||
if (m_LocalGridService.DeregisterRegion(regionID))
|
||||
return base.DeregisterRegion(regionID);
|
||||
return m_RemoteGridService.DeregisterRegion(regionID);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
|
||||
public List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID)
|
||||
{
|
||||
return base.GetNeighbours(scopeID, regionID);
|
||||
return m_RemoteGridService.GetNeighbours(scopeID, regionID);
|
||||
}
|
||||
|
||||
public override GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
|
||||
public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
|
||||
{
|
||||
GridRegion rinfo = m_LocalGridService.GetRegionByUUID(scopeID, regionID);
|
||||
if (rinfo == null)
|
||||
rinfo = base.GetRegionByUUID(scopeID, regionID);
|
||||
rinfo = m_RemoteGridService.GetRegionByUUID(scopeID, regionID);
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public override GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
{
|
||||
GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
|
||||
if (rinfo == null)
|
||||
rinfo = base.GetRegionByPosition(scopeID, x, y);
|
||||
rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public override GridRegion GetRegionByName(UUID scopeID, string regionName)
|
||||
public GridRegion GetRegionByName(UUID scopeID, string regionName)
|
||||
{
|
||||
GridRegion rinfo = m_LocalGridService.GetRegionByName(scopeID, regionName);
|
||||
if (rinfo == null)
|
||||
rinfo = base.GetRegionByName(scopeID, regionName);
|
||||
rinfo = m_RemoteGridService.GetRegionByName(scopeID, regionName);
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public override List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
public List<GridRegion> GetRegionsByName(UUID scopeID, string name, int maxNumber)
|
||||
{
|
||||
List<GridRegion> rinfo = m_LocalGridService.GetRegionsByName(scopeID, name, maxNumber);
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionsByName {0} found {1} regions", name, rinfo.Count);
|
||||
List<GridRegion> grinfo = base.GetRegionsByName(scopeID, name, maxNumber);
|
||||
List<GridRegion> grinfo = m_RemoteGridService.GetRegionsByName(scopeID, name, maxNumber);
|
||||
|
||||
if (grinfo != null)
|
||||
{
|
||||
|
@ -202,13 +201,79 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
|||
return rinfo;
|
||||
}
|
||||
|
||||
// Let's not override GetRegionRange -- let's get them all from the grid server
|
||||
public virtual List<GridRegion> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
|
||||
{
|
||||
List<GridRegion> rinfo = m_LocalGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetRegionRange {0} found {1} regions", name, rinfo.Count);
|
||||
List<GridRegion> grinfo = m_RemoteGridService.GetRegionRange(scopeID, xmin, xmax, ymin, ymax);
|
||||
|
||||
public override int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||
if (grinfo != null)
|
||||
{
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetRegionRange {0} found {1} regions", name, grinfo.Count);
|
||||
foreach (GridRegion r in grinfo)
|
||||
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
|
||||
rinfo.Add(r);
|
||||
}
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetDefaultRegions(UUID scopeID)
|
||||
{
|
||||
List<GridRegion> rinfo = m_LocalGridService.GetDefaultRegions(scopeID);
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetDefaultRegions {0} found {1} regions", name, rinfo.Count);
|
||||
List<GridRegion> grinfo = m_RemoteGridService.GetDefaultRegions(scopeID);
|
||||
|
||||
if (grinfo != null)
|
||||
{
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetDefaultRegions {0} found {1} regions", name, grinfo.Count);
|
||||
foreach (GridRegion r in grinfo)
|
||||
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
|
||||
rinfo.Add(r);
|
||||
}
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetFallbackRegions(UUID scopeID, int x, int y)
|
||||
{
|
||||
List<GridRegion> rinfo = m_LocalGridService.GetFallbackRegions(scopeID, x, y);
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetFallbackRegions {0} found {1} regions", name, rinfo.Count);
|
||||
List<GridRegion> grinfo = m_RemoteGridService.GetFallbackRegions(scopeID, x, y);
|
||||
|
||||
if (grinfo != null)
|
||||
{
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetFallbackRegions {0} found {1} regions", name, grinfo.Count);
|
||||
foreach (GridRegion r in grinfo)
|
||||
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
|
||||
rinfo.Add(r);
|
||||
}
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||
{
|
||||
List<GridRegion> rinfo = m_LocalGridService.GetHyperlinks(scopeID);
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Local GetHyperlinks {0} found {1} regions", name, rinfo.Count);
|
||||
List<GridRegion> grinfo = m_RemoteGridService.GetHyperlinks(scopeID);
|
||||
|
||||
if (grinfo != null)
|
||||
{
|
||||
//m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetHyperlinks {0} found {1} regions", name, grinfo.Count);
|
||||
foreach (GridRegion r in grinfo)
|
||||
if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null)
|
||||
rinfo.Add(r);
|
||||
}
|
||||
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||
{
|
||||
int flags = m_LocalGridService.GetRegionFlags(scopeID, regionID);
|
||||
if (flags == -1)
|
||||
flags = base.GetRegionFlags(scopeID, regionID);
|
||||
flags = m_RemoteGridService.GetRegionFlags(scopeID, regionID);
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
|
|
@ -93,13 +93,13 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
}
|
||||
|
||||
// try to fetch from GridServer
|
||||
List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(UUID.Zero, mapName, 20);
|
||||
List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
|
||||
if (regionInfos == null)
|
||||
{
|
||||
m_log.Warn("[MAPSEARCHMODULE]: RequestNamedRegions returned null. Old gridserver?");
|
||||
// service wasn't available; maybe still an old GridServer. Try the old API, though it will return only one region
|
||||
regionInfos = new List<GridRegion>();
|
||||
GridRegion info = m_scene.GridService.GetRegionByName(UUID.Zero, mapName);
|
||||
GridRegion info = m_scene.GridService.GetRegionByName(m_scene.RegionInfo.ScopeID, mapName);
|
||||
if (info != null) regionInfos.Add(info);
|
||||
}
|
||||
|
||||
|
|
|
@ -593,7 +593,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
|||
if (!m_blacklistedregions.ContainsKey(regionhandle))
|
||||
m_blacklistedregions.Add(regionhandle, Environment.TickCount);
|
||||
}
|
||||
m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString());
|
||||
//m_log.InfoFormat("[WORLD MAP]: Blacklisted region {0}", regionhandle.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue