From 54b1071556edf264835f990bb3595064d2b2e2f0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 2 Aug 2013 23:12:54 +0100 Subject: Allow older teleport ConnectorProtocolVersion of "SIMULATION/0.1" to be manually forced in a new [SimulationService] config setting. This is for testing and debugging purposes to help determine whether a particular issue may be teleport related or not "SIMULATION/0.2" (the newer teleport protocol) remains the default. If the source simulator only implements "SIMULATION/0.1" this will correctly allow fallback to the older protocol. Specifying "SIMULATION/0.1" will force the older, less efficient protocol to always be used. --- .../Simulation/LocalSimulationConnector.cs | 33 +++++++++++++--------- .../Simulation/RemoteSimulationConnector.cs | 21 ++++++-------- 2 files changed, 27 insertions(+), 27 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 697ce68..7aadb87 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs @@ -63,35 +63,40 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation /// private bool m_ModuleEnabled = false; - public LocalSimulationConnectorModule() - { - ServiceVersion = "SIMULATION/0.2"; - } - #region Region Module interface - public void Initialise(IConfigSource config) + public void Initialise(IConfigSource configSource) { - IConfig moduleConfig = config.Configs["Modules"]; + IConfig moduleConfig = configSource.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("SimulationServices", ""); if (name == Name) { - //IConfig userConfig = config.Configs["SimulationService"]; - //if (userConfig == null) - //{ - // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpenSim.ini"); - // return; - //} + InitialiseService(configSource); m_ModuleEnabled = true; - m_log.Info("[SIMULATION CONNECTOR]: Local simulation enabled"); + m_log.Info("[LOCAL SIMULATION CONNECTOR]: Local simulation enabled."); } } } + public void InitialiseService(IConfigSource configSource) + { + IConfig config = configSource.Configs["SimulationService"]; + if (config != null) + { + ServiceVersion = config.GetString("ConnectorProtocolVersion", "SIMULATION/0.2"); + + if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2") + throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion)); + + m_log.InfoFormat( + "[LOCAL SIMULATION CONNECTOR]: Initialzied with connector protocol version {0}", ServiceVersion); + } + } + public void PostInitialise() { } diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 8722b80..f45f560 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs @@ -50,9 +50,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteSimulationConnectorModule")] public class RemoteSimulationConnectorModule : ISharedRegionModule, ISimulationService { - private bool initialized = false; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private bool initialized = false; protected bool m_enabled = false; protected Scene m_aScene; // RemoteSimulationConnector does not care about local regions; it delegates that to the Local module @@ -64,27 +64,23 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation #region Region Module interface - public virtual void Initialise(IConfigSource config) + public virtual void Initialise(IConfigSource configSource) { - - IConfig moduleConfig = config.Configs["Modules"]; + IConfig moduleConfig = configSource.Configs["Modules"]; if (moduleConfig != null) { string name = moduleConfig.GetString("SimulationServices", ""); if (name == Name) { - //IConfig userConfig = config.Configs["SimulationService"]; - //if (userConfig == null) - //{ - // m_log.Error("[AVATAR CONNECTOR]: SimulationService missing from OpenSim.ini"); - // return; - //} + m_localBackend = new LocalSimulationConnectorModule(); + + m_localBackend.InitialiseService(configSource); m_remoteConnector = new SimulationServiceConnector(); m_enabled = true; - m_log.Info("[SIMULATION CONNECTOR]: Remote simulation enabled"); + m_log.Info("[REMOTE SIMULATION CONNECTOR]: Remote simulation enabled."); } } } @@ -142,8 +138,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation } protected virtual void InitOnce(Scene scene) - { - m_localBackend = new LocalSimulationConnectorModule(); + { m_aScene = scene; //m_regionClient = new RegionToRegionClient(m_aScene, m_hyperlinkService); m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); -- cgit v1.1