* Updates RESTInterregionComms and LocalInterregionComms to the new region module interface. This fixes an issue where region references were being added but weren't being deleted,
causing those "unnotified circuit" messages. * Also fixes tests accordingly - Fixes Mantis #3452 - Fixes Mantis #3388 - Fixes Mantis #3871 - Related to Mantis #3493trunk
parent
a133e83f3a
commit
7bf59c551e
|
@ -30,6 +30,8 @@
|
||||||
<RegionModule id="RemoteNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.RemoteNeighbourServicesConnector" />
|
<RegionModule id="RemoteNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.RemoteNeighbourServicesConnector" />
|
||||||
<RegionModule id="LocalLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.LocalLandServicesConnector" />
|
<RegionModule id="LocalLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.LocalLandServicesConnector" />
|
||||||
<RegionModule id="RemoteLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.RemoteLandServicesConnector" />
|
<RegionModule id="RemoteLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.RemoteLandServicesConnector" />
|
||||||
|
<RegionModule id="LocalInterregionComms" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion.LocalInterregionComms" />
|
||||||
|
<RegionModule id="RESTInterregionComms" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion.RESTInterregionComms" />
|
||||||
<!-- Service connectors IN modules -->
|
<!-- Service connectors IN modules -->
|
||||||
<RegionModule id="AssetServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset.AssetServiceInConnectorModule" />
|
<RegionModule id="AssetServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Asset.AssetServiceInConnectorModule" />
|
||||||
<RegionModule id="InventoryServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory.InventoryServiceInConnectorModule" />
|
<RegionModule id="InventoryServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Inventory.InventoryServiceInConnectorModule" />
|
||||||
|
|
|
@ -36,7 +36,7 @@ using OpenSim.Region.Framework.Scenes;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
{
|
{
|
||||||
public class LocalInterregionComms : IRegionModule, IInterregionCommsOut, IInterregionCommsIn
|
public class LocalInterregionComms : ISharedRegionModule, IInterregionCommsOut, IInterregionCommsIn
|
||||||
{
|
{
|
||||||
private bool m_enabled = false;
|
private bool m_enabled = false;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
|
|
||||||
#region IRegionModule
|
#region IRegionModule
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource config)
|
public void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
if (m_sceneList.Count == 0)
|
if (m_sceneList.Count == 0)
|
||||||
{
|
{
|
||||||
|
@ -62,30 +62,61 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Init(scene);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PostInitialise()
|
public void PostInitialise()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddRegion(Scene scene)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegion(Scene scene)
|
||||||
|
{
|
||||||
|
if (m_enabled)
|
||||||
|
{
|
||||||
|
RemoveScene(scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegionLoaded(Scene scene)
|
||||||
|
{
|
||||||
|
if (m_enabled)
|
||||||
|
{
|
||||||
|
Init(scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Type ReplacableInterface
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return "LocalInterregionCommsModule"; }
|
get { return "LocalInterregionCommsModule"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsSharedModule
|
/// <summary>
|
||||||
|
/// Can be called from other modules.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="scene"></param>
|
||||||
|
public void RemoveScene(Scene scene)
|
||||||
{
|
{
|
||||||
get { return true; }
|
lock (m_sceneList)
|
||||||
|
{
|
||||||
|
if (m_sceneList.Contains(scene))
|
||||||
|
{
|
||||||
|
m_sceneList.Remove(scene);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Can be called from other modules.
|
/// Can be called from other modules.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -45,7 +45,7 @@ using OpenSim.Region.Framework.Scenes.Serialization;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
{
|
{
|
||||||
public class RESTInterregionComms : IRegionModule, IInterregionCommsOut
|
public class RESTInterregionComms : ISharedRegionModule, IInterregionCommsOut
|
||||||
{
|
{
|
||||||
private bool initialized = false;
|
private bool initialized = false;
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
@ -64,53 +64,65 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Interregion
|
||||||
|
|
||||||
#region IRegionModule
|
#region IRegionModule
|
||||||
|
|
||||||
public virtual void Initialise(Scene scene, IConfigSource config)
|
public virtual void Initialise(IConfigSource config)
|
||||||
{
|
{
|
||||||
if (!initialized)
|
|
||||||
{
|
|
||||||
initialized = true;
|
|
||||||
IConfig startupConfig = config.Configs["Communications"];
|
IConfig startupConfig = config.Configs["Communications"];
|
||||||
|
|
||||||
if ((startupConfig == null)
|
if ((startupConfig == null) || ((startupConfig != null)
|
||||||
|| (startupConfig != null)
|
&& (startupConfig.GetString("InterregionComms", "RESTComms") == "RESTComms")))
|
||||||
&& (startupConfig.GetString("InterregionComms", "RESTComms") == "RESTComms"))
|
|
||||||
{
|
{
|
||||||
m_log.Info("[REST COMMS]: Enabling InterregionComms RESTComms module");
|
m_log.Info("[REST COMMS]: Enabling InterregionComms RESTComms module");
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
if (config.Configs["Hypergrid"] != null)
|
if (config.Configs["Hypergrid"] != null)
|
||||||
m_safemode = config.Configs["Hypergrid"].GetBoolean("safemode", false);
|
m_safemode = config.Configs["Hypergrid"].GetBoolean("safemode", false);
|
||||||
|
|
||||||
InitOnce(scene);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_enabled)
|
|
||||||
return;
|
|
||||||
|
|
||||||
InitEach(scene);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void PostInitialise()
|
public virtual void PostInitialise()
|
||||||
{
|
{
|
||||||
if (m_enabled)
|
|
||||||
AddHTTPHandlers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Close()
|
public virtual void Close()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddRegion(Scene scene)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveRegion(Scene scene)
|
||||||
|
{
|
||||||
|
if (m_enabled)
|
||||||
|
{
|
||||||
|
m_localBackend.RemoveScene(scene);
|
||||||
|
scene.UnregisterModuleInterface<IInterregionCommsOut>(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RegionLoaded(Scene scene)
|
||||||
|
{
|
||||||
|
if (m_enabled)
|
||||||
|
{
|
||||||
|
if (!initialized)
|
||||||
|
{
|
||||||
|
InitOnce(scene);
|
||||||
|
initialized = true;
|
||||||
|
AddHTTPHandlers();
|
||||||
|
}
|
||||||
|
InitEach(scene);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Type ReplacableInterface
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
public virtual string Name
|
public virtual string Name
|
||||||
{
|
{
|
||||||
get { return "RESTInterregionCommsModule"; }
|
get { return "RESTInterregionCommsModule"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool IsSharedModule
|
|
||||||
{
|
|
||||||
get { return true; }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void InitEach(Scene scene)
|
protected virtual void InitEach(Scene scene)
|
||||||
{
|
{
|
||||||
m_localBackend.Init(scene);
|
m_localBackend.Init(scene);
|
||||||
|
|
|
@ -71,10 +71,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000, cm);
|
scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000, cm);
|
||||||
scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm);
|
scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm);
|
||||||
|
|
||||||
IRegionModule interregionComms = new RESTInterregionComms();
|
ISharedRegionModule interregionComms = new RESTInterregionComms();
|
||||||
interregionComms.Initialise(scene, new IniConfigSource());
|
interregionComms.Initialise(new IniConfigSource());
|
||||||
interregionComms.Initialise(scene2, new IniConfigSource());
|
|
||||||
interregionComms.Initialise(scene3, new IniConfigSource());
|
|
||||||
interregionComms.PostInitialise();
|
interregionComms.PostInitialise();
|
||||||
SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms);
|
SceneSetupHelpers.SetupSceneModules(scene, new IniConfigSource(), interregionComms);
|
||||||
SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms);
|
SceneSetupHelpers.SetupSceneModules(scene2, new IniConfigSource(), interregionComms);
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
TestCommunicationsManager cm = new TestCommunicationsManager();
|
TestCommunicationsManager cm = new TestCommunicationsManager();
|
||||||
|
|
||||||
// shared module
|
// shared module
|
||||||
IRegionModule interregionComms = new RESTInterregionComms();
|
ISharedRegionModule interregionComms = new RESTInterregionComms();
|
||||||
|
|
||||||
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
|
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm);
|
||||||
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
|
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
|
||||||
|
|
|
@ -214,6 +214,7 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
foreach (IRegionModuleBase module in newModules)
|
foreach (IRegionModuleBase module in newModules)
|
||||||
{
|
{
|
||||||
module.AddRegion(scene);
|
module.AddRegion(scene);
|
||||||
|
module.RegionLoaded(scene);
|
||||||
scene.AddRegionModule(module.Name, module);
|
scene.AddRegionModule(module.Name, module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue