CommunicationsManager deleted.
parent
ca75ad6743
commit
001d369568
|
@ -1,58 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) Contributors, http://opensimulator.org/
|
|
||||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* * Neither the name of the OpenSimulator Project nor the
|
|
||||||
* names of its contributors may be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using OpenMetaverse;
|
|
||||||
using OpenSim.Framework.Communications.Cache;
|
|
||||||
|
|
||||||
namespace OpenSim.Framework.Communications
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// This class manages references to OpenSim non-region services (inventory, user, etc.)
|
|
||||||
/// </summary>
|
|
||||||
///
|
|
||||||
/// TODO: Service retrieval needs to be managed via plugin and interfaces requests, as happens for region
|
|
||||||
/// modules from scene. Among other things, this will allow this class to be used in many different contexts
|
|
||||||
/// (from a grid service executable, to provide services on a region) without lots of messy nulls and confusion.
|
|
||||||
/// Also, a post initialize step on the plugins will be needed so that we don't get tortuous problems with
|
|
||||||
/// circular dependencies between plugins.
|
|
||||||
public class CommunicationsManager
|
|
||||||
{
|
|
||||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Constructor
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="serversInfo"></param>
|
|
||||||
public CommunicationsManager(NetworkServersInfo serversInfo,
|
|
||||||
LibraryRootFolder libraryRootFolder)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -44,14 +44,14 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager,
|
public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager,
|
||||||
StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
|
StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version)
|
||||||
{
|
{
|
||||||
HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService(m_commsManager);
|
HGSceneCommunicationService sceneGridService = new HGSceneCommunicationService();
|
||||||
|
|
||||||
return
|
return
|
||||||
new HGScene(
|
new HGScene(
|
||||||
regionInfo, circuitManager, m_commsManager, sceneGridService, storageManager,
|
regionInfo, circuitManager, sceneGridService, storageManager,
|
||||||
m_moduleLoader, false, m_configSettings.PhysicalPrim,
|
m_moduleLoader, false, m_configSettings.PhysicalPrim,
|
||||||
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
|
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,13 +607,13 @@ namespace OpenSim
|
||||||
{
|
{
|
||||||
bool hgrid = ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false);
|
bool hgrid = ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false);
|
||||||
if (hgrid)
|
if (hgrid)
|
||||||
return HGCommands.CreateScene(regionInfo, circuitManager, m_commsManager,
|
return HGCommands.CreateScene(regionInfo, circuitManager,
|
||||||
storageManager, m_moduleLoader, m_configSettings, m_config, m_version);
|
storageManager, m_moduleLoader, m_configSettings, m_config, m_version);
|
||||||
|
|
||||||
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
|
SceneCommunicationService sceneGridService = new SceneCommunicationService();
|
||||||
|
|
||||||
return new Scene(
|
return new Scene(
|
||||||
regionInfo, circuitManager, m_commsManager, sceneGridService,
|
regionInfo, circuitManager, sceneGridService,
|
||||||
storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim,
|
storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim,
|
||||||
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
|
m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,13 +56,6 @@ namespace OpenSim.Region.ClientStack
|
||||||
|
|
||||||
protected uint m_httpServerPort;
|
protected uint m_httpServerPort;
|
||||||
|
|
||||||
public CommunicationsManager CommunicationsManager
|
|
||||||
{
|
|
||||||
get { return m_commsManager; }
|
|
||||||
set { m_commsManager = value; }
|
|
||||||
}
|
|
||||||
protected CommunicationsManager m_commsManager;
|
|
||||||
|
|
||||||
protected StorageManager m_storageManager;
|
protected StorageManager m_storageManager;
|
||||||
|
|
||||||
protected ClientStackManager m_clientStackManager;
|
protected ClientStackManager m_clientStackManager;
|
||||||
|
|
|
@ -157,7 +157,6 @@ namespace OpenSim.Region.CoreModules.Framework.Library
|
||||||
|
|
||||||
RegionInfo regInfo = new RegionInfo();
|
RegionInfo regInfo = new RegionInfo();
|
||||||
Scene m_MockScene = new Scene(regInfo);
|
Scene m_MockScene = new Scene(regInfo);
|
||||||
m_MockScene.CommsManager = m_Scene.CommsManager;
|
|
||||||
LocalInventoryService invService = new LocalInventoryService(lib);
|
LocalInventoryService invService = new LocalInventoryService(lib);
|
||||||
m_MockScene.RegisterModuleInterface<IInventoryService>(invService);
|
m_MockScene.RegisterModuleInterface<IInventoryService>(invService);
|
||||||
m_MockScene.RegisterModuleInterface<IAssetService>(m_Scene.AssetService);
|
m_MockScene.RegisterModuleInterface<IAssetService>(m_Scene.AssetService);
|
||||||
|
|
|
@ -46,7 +46,6 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private readonly List<Scene> m_scenes = new List<Scene>();
|
private readonly List<Scene> m_scenes = new List<Scene>();
|
||||||
private CommunicationsManager m_com;
|
|
||||||
private IConfigSource m_settings;
|
private IConfigSource m_settings;
|
||||||
|
|
||||||
#region Implementation of IRegionModuleBase
|
#region Implementation of IRegionModuleBase
|
||||||
|
@ -88,7 +87,6 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||||
{
|
{
|
||||||
if (m_settings.Configs["Startup"].GetBoolean("gridmode", false))
|
if (m_settings.Configs["Startup"].GetBoolean("gridmode", false))
|
||||||
{
|
{
|
||||||
m_com = m_scenes[0].CommsManager;
|
|
||||||
MainServer.Instance.AddXmlRPCHandler("grid_message", GridWideMessage);
|
MainServer.Instance.AddXmlRPCHandler("grid_message", GridWideMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
protected LocalSimulationConnectorModule m_localBackend;
|
protected LocalSimulationConnectorModule m_localBackend;
|
||||||
protected SimulationServiceConnector m_remoteConnector;
|
protected SimulationServiceConnector m_remoteConnector;
|
||||||
|
|
||||||
protected CommunicationsManager m_commsManager;
|
|
||||||
|
|
||||||
protected IHyperlinkService m_hyperlinkService;
|
protected IHyperlinkService m_hyperlinkService;
|
||||||
|
|
||||||
protected bool m_safemode;
|
protected bool m_safemode;
|
||||||
|
@ -150,7 +148,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||||
protected virtual void InitOnce(Scene scene)
|
protected virtual void InitOnce(Scene scene)
|
||||||
{
|
{
|
||||||
m_localBackend = new LocalSimulationConnectorModule();
|
m_localBackend = new LocalSimulationConnectorModule();
|
||||||
m_commsManager = scene.CommsManager;
|
|
||||||
m_aScene = scene;
|
m_aScene = scene;
|
||||||
//m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService);
|
//m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService);
|
||||||
m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName);
|
m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName);
|
||||||
|
|
|
@ -64,11 +64,11 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public HGScene(RegionInfo regInfo, AgentCircuitManager authen,
|
public HGScene(RegionInfo regInfo, AgentCircuitManager authen,
|
||||||
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
|
SceneCommunicationService sceneGridService,
|
||||||
StorageManager storeManager,
|
StorageManager storeManager,
|
||||||
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
|
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
|
||||||
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
||||||
: base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader,
|
: base(regInfo, authen, sceneGridService, storeManager, moduleLoader,
|
||||||
dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion)
|
dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion)
|
||||||
{
|
{
|
||||||
m_log.Info("[HGScene]: Starting HGScene.");
|
m_log.Info("[HGScene]: Starting HGScene.");
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public HGSceneCommunicationService(CommunicationsManager commsMan) : base(commsMan)
|
public HGSceneCommunicationService() : base()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
protected ModuleLoader m_moduleLoader;
|
protected ModuleLoader m_moduleLoader;
|
||||||
protected StorageManager m_storageManager;
|
protected StorageManager m_storageManager;
|
||||||
protected AgentCircuitManager m_authenticateHandler;
|
protected AgentCircuitManager m_authenticateHandler;
|
||||||
public CommunicationsManager CommsManager;
|
|
||||||
|
|
||||||
protected SceneCommunicationService m_sceneGridService;
|
protected SceneCommunicationService m_sceneGridService;
|
||||||
public bool loginsdisabled = true;
|
public bool loginsdisabled = true;
|
||||||
|
@ -547,7 +546,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public Scene(RegionInfo regInfo, AgentCircuitManager authen,
|
public Scene(RegionInfo regInfo, AgentCircuitManager authen,
|
||||||
CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
|
SceneCommunicationService sceneGridService,
|
||||||
StorageManager storeManager,
|
StorageManager storeManager,
|
||||||
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
|
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
|
||||||
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
||||||
|
@ -583,7 +582,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue/2))+(uint)(uint.MaxValue/4);
|
m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue/2))+(uint)(uint.MaxValue/4);
|
||||||
m_moduleLoader = moduleLoader;
|
m_moduleLoader = moduleLoader;
|
||||||
m_authenticateHandler = authen;
|
m_authenticateHandler = authen;
|
||||||
CommsManager = commsMan;
|
|
||||||
m_sceneGridService = sceneGridService;
|
m_sceneGridService = sceneGridService;
|
||||||
m_storageManager = storeManager;
|
m_storageManager = storeManager;
|
||||||
m_regInfo = regInfo;
|
m_regInfo = regInfo;
|
||||||
|
|
|
@ -56,7 +56,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
protected CommunicationsManager m_commsProvider;
|
|
||||||
protected RegionInfo m_regionInfo;
|
protected RegionInfo m_regionInfo;
|
||||||
protected Scene m_scene;
|
protected Scene m_scene;
|
||||||
|
|
||||||
|
@ -124,9 +123,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public KiPrimitiveDelegate KiPrimitive;
|
public KiPrimitiveDelegate KiPrimitive;
|
||||||
|
|
||||||
public SceneCommunicationService(CommunicationsManager commsMan)
|
public SceneCommunicationService()
|
||||||
{
|
{
|
||||||
m_commsProvider = commsMan;
|
|
||||||
m_agentsInTransit = new List<UUID>();
|
m_agentsInTransit = new List<UUID>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,6 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
public UUID agent1, agent2, agent3;
|
public UUID agent1, agent2, agent3;
|
||||||
public static Random random;
|
public static Random random;
|
||||||
public ulong region1,region2,region3;
|
public ulong region1,region2,region3;
|
||||||
public TestCommunicationsManager cm;
|
|
||||||
public AgentCircuitData acd1;
|
public AgentCircuitData acd1;
|
||||||
public SceneObjectGroup sog1, sog2, sog3;
|
public SceneObjectGroup sog1, sog2, sog3;
|
||||||
public TestClient testclient;
|
public TestClient testclient;
|
||||||
|
@ -66,10 +65,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[TestFixtureSetUp]
|
[TestFixtureSetUp]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
cm = new TestCommunicationsManager();
|
scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000);
|
||||||
scene = SceneSetupHelpers.SetupScene("Neighbour x", UUID.Random(), 1000, 1000, cm);
|
scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000);
|
||||||
scene2 = SceneSetupHelpers.SetupScene("Neighbour x+1", UUID.Random(), 1001, 1000, cm);
|
scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000);
|
||||||
scene3 = SceneSetupHelpers.SetupScene("Neighbour x-1", UUID.Random(), 999, 1000, cm);
|
|
||||||
|
|
||||||
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
||||||
interregionComms.Initialise(new IniConfigSource());
|
interregionComms.Initialise(new IniConfigSource());
|
||||||
|
|
|
@ -132,7 +132,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
RegionInfo regionInfo = new RegionInfo(0,0,null,null);
|
RegionInfo regionInfo = new RegionInfo(0,0,null,null);
|
||||||
FakeStorageManager storageManager = new FakeStorageManager();
|
FakeStorageManager storageManager = new FakeStorageManager();
|
||||||
|
|
||||||
new Scene(regionInfo, null, null, null, storageManager, null, false, false, false, null, null);
|
new Scene(regionInfo, null, null, storageManager, null, false, false, false, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,17 +113,16 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
|
|
||||||
UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
|
UUID sceneAId = UUID.Parse("00000000-0000-0000-0000-000000000100");
|
||||||
UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
|
UUID sceneBId = UUID.Parse("00000000-0000-0000-0000-000000000200");
|
||||||
TestCommunicationsManager cm = new TestCommunicationsManager();
|
|
||||||
|
|
||||||
// shared module
|
// shared module
|
||||||
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
ISharedRegionModule interregionComms = new LocalSimulationConnectorModule();
|
||||||
|
|
||||||
|
|
||||||
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, cm, "grid");
|
Scene sceneB = SceneSetupHelpers.SetupScene("sceneB", sceneBId, 1010, 1010, "grid");
|
||||||
SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
|
SceneSetupHelpers.SetupSceneModules(sceneB, new IniConfigSource(), interregionComms);
|
||||||
sceneB.RegisterRegionWithGrid();
|
sceneB.RegisterRegionWithGrid();
|
||||||
|
|
||||||
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, cm, "grid");
|
Scene sceneA = SceneSetupHelpers.SetupScene("sceneA", sceneAId, 1000, 1000, "grid");
|
||||||
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
|
SceneSetupHelpers.SetupSceneModules(sceneA, new IniConfigSource(), interregionComms);
|
||||||
sceneA.RegisterRegionWithGrid();
|
sceneA.RegisterRegionWithGrid();
|
||||||
|
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) Contributors, http://opensimulator.org/
|
|
||||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* * Neither the name of the OpenSimulator Project nor the
|
|
||||||
* names of its contributors may be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using OpenSim.Framework;
|
|
||||||
using OpenSim.Framework.Communications;
|
|
||||||
using OpenSim.Framework.Communications.Cache;
|
|
||||||
using OpenSim.Framework.Servers;
|
|
||||||
using OpenSim.Framework.Servers.HttpServer;
|
|
||||||
using OpenSim.Data;
|
|
||||||
|
|
||||||
namespace OpenSim.Tests.Common.Mock
|
|
||||||
{
|
|
||||||
public class TestCommunicationsManager : CommunicationsManager
|
|
||||||
{
|
|
||||||
public IUserDataPlugin UserDataPlugin
|
|
||||||
{
|
|
||||||
get { return m_userDataPlugin; }
|
|
||||||
}
|
|
||||||
private IUserDataPlugin m_userDataPlugin;
|
|
||||||
|
|
||||||
// public IInventoryDataPlugin InventoryDataPlugin
|
|
||||||
// {
|
|
||||||
// get { return m_inventoryDataPlugin; }
|
|
||||||
// }
|
|
||||||
// private IInventoryDataPlugin m_inventoryDataPlugin;
|
|
||||||
|
|
||||||
public TestCommunicationsManager()
|
|
||||||
: this(null)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public TestCommunicationsManager(NetworkServersInfo serversInfo)
|
|
||||||
: base(serversInfo, null)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -40,10 +40,10 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
{
|
{
|
||||||
public TestScene(
|
public TestScene(
|
||||||
RegionInfo regInfo, AgentCircuitManager authen,
|
RegionInfo regInfo, AgentCircuitManager authen,
|
||||||
CommunicationsManager commsMan, SceneCommunicationService sceneGridService, StorageManager storeManager,
|
SceneCommunicationService sceneGridService, StorageManager storeManager,
|
||||||
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
|
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim,
|
||||||
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion)
|
||||||
: base(regInfo, authen, commsMan, sceneGridService, storeManager, moduleLoader,
|
: base(regInfo, authen, sceneGridService, storeManager, moduleLoader,
|
||||||
dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion)
|
dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,6 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
private static ISharedRegionModule m_assetService = null;
|
private static ISharedRegionModule m_assetService = null;
|
||||||
private static ISharedRegionModule m_inventoryService = null;
|
private static ISharedRegionModule m_inventoryService = null;
|
||||||
private static ISharedRegionModule m_gridService = null;
|
private static ISharedRegionModule m_gridService = null;
|
||||||
private static TestCommunicationsManager commsManager = null;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set up a test scene
|
/// Set up a test scene
|
||||||
|
@ -83,21 +82,23 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
public static TestScene SetupScene(String realServices)
|
public static TestScene SetupScene(String realServices)
|
||||||
{
|
{
|
||||||
return SetupScene(
|
return SetupScene(
|
||||||
"Unit test region", UUID.Random(), 1000, 1000, new TestCommunicationsManager(), realServices);
|
"Unit test region", UUID.Random(), 1000, 1000, realServices);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
// REFACTORING PROBLEM. No idea what the difference is with the previous one
|
||||||
/// Set up a test scene
|
///// <summary>
|
||||||
/// </summary>
|
///// Set up a test scene
|
||||||
///
|
///// </summary>
|
||||||
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
|
/////
|
||||||
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
|
///// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
|
||||||
/// <returns></returns>
|
///// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
|
||||||
public static TestScene SetupScene(TestCommunicationsManager cm, String realServices)
|
///// <returns></returns>
|
||||||
{
|
//public static TestScene SetupScene(String realServices)
|
||||||
return SetupScene(
|
//{
|
||||||
"Unit test region", UUID.Random(), 1000, 1000, cm, "");
|
// return SetupScene(
|
||||||
}
|
// "Unit test region", UUID.Random(), 1000, 1000, "");
|
||||||
|
//}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set up a test scene
|
/// Set up a test scene
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -107,9 +108,9 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
/// <param name="y">Y co-ordinate of the region</param>
|
/// <param name="y">Y co-ordinate of the region</param>
|
||||||
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
|
/// <param name="cm">This should be the same if simulating two scenes within a standalone</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static TestScene SetupScene(string name, UUID id, uint x, uint y, TestCommunicationsManager cm)
|
public static TestScene SetupScene(string name, UUID id, uint x, uint y)
|
||||||
{
|
{
|
||||||
return SetupScene(name, id, x, y, cm, "");
|
return SetupScene(name, id, x, y,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,23 +126,24 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
|
/// <param name="realServices">Starts real inventory and asset services, as opposed to mock ones, if true</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static TestScene SetupScene(
|
public static TestScene SetupScene(
|
||||||
string name, UUID id, uint x, uint y, TestCommunicationsManager cm, String realServices)
|
string name, UUID id, uint x, uint y, String realServices)
|
||||||
{
|
{
|
||||||
bool newScene = false;
|
bool newScene = false;
|
||||||
|
|
||||||
Console.WriteLine("Setting up test scene {0}", name);
|
Console.WriteLine("Setting up test scene {0}", name);
|
||||||
|
|
||||||
// If cm is the same as our last commsManager used, this means the tester wants to link
|
// REFACTORING PROBLEM!
|
||||||
// regions. In this case, don't use the sameshared region modules and dont initialize them again.
|
//// If cm is the same as our last commsManager used, this means the tester wants to link
|
||||||
// Also, no need to start another MainServer and MainConsole instance.
|
//// regions. In this case, don't use the sameshared region modules and dont initialize them again.
|
||||||
if (cm == null || cm != commsManager)
|
//// Also, no need to start another MainServer and MainConsole instance.
|
||||||
{
|
//if (cm == null || cm != commsManager)
|
||||||
System.Console.WriteLine("Starting a brand new scene");
|
//{
|
||||||
newScene = true;
|
// System.Console.WriteLine("Starting a brand new scene");
|
||||||
MainConsole.Instance = new LocalConsole("TEST PROMPT");
|
// newScene = true;
|
||||||
MainServer.Instance = new BaseHttpServer(980);
|
// MainConsole.Instance = new LocalConsole("TEST PROMPT");
|
||||||
commsManager = cm;
|
// MainServer.Instance = new BaseHttpServer(980);
|
||||||
}
|
// commsManager = cm;
|
||||||
|
//}
|
||||||
|
|
||||||
// We must set up a console otherwise setup of some modules may fail
|
// We must set up a console otherwise setup of some modules may fail
|
||||||
RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
|
RegionInfo regInfo = new RegionInfo(x, y, new IPEndPoint(IPAddress.Loopback, 9000), "127.0.0.1");
|
||||||
|
@ -149,13 +151,13 @@ namespace OpenSim.Tests.Common.Setup
|
||||||
regInfo.RegionID = id;
|
regInfo.RegionID = id;
|
||||||
|
|
||||||
AgentCircuitManager acm = new AgentCircuitManager();
|
AgentCircuitManager acm = new AgentCircuitManager();
|
||||||
SceneCommunicationService scs = new SceneCommunicationService(cm);
|
SceneCommunicationService scs = new SceneCommunicationService();
|
||||||
|
|
||||||
StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
|
StorageManager sm = new StorageManager("OpenSim.Data.Null.dll", "", "");
|
||||||
IConfigSource configSource = new IniConfigSource();
|
IConfigSource configSource = new IniConfigSource();
|
||||||
|
|
||||||
TestScene testScene = new TestScene(
|
TestScene testScene = new TestScene(
|
||||||
regInfo, acm, cm, scs, sm, null, false, false, false, configSource, null);
|
regInfo, acm, scs, sm, null, false, false, false, configSource, null);
|
||||||
|
|
||||||
INonSharedRegionModule capsModule = new CapabilitiesModule();
|
INonSharedRegionModule capsModule = new CapabilitiesModule();
|
||||||
capsModule.Initialise(new IniConfigSource());
|
capsModule.Initialise(new IniConfigSource());
|
||||||
|
|
Loading…
Reference in New Issue