From e0a6691932244c57acbcfc94bae240db0772ea51 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 17:59:21 +0000 Subject: [PATCH 1/2] Rename the files and classes from XEstate to Estate The names conflict with it's ancestor module and the code is nothing like the out of core XEstateModule, so it should not be named the same. --- .../World/Estate/{XEstateConnector.cs => EstateConnector.cs} | 4 ++-- .../World/Estate/{XEstateModule.cs => EstateModule.cs} | 2 +- .../{XEstateRequestHandler.cs => EstateRequestHandler.cs} | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename OpenSim/Region/CoreModules/World/Estate/{XEstateConnector.cs => EstateConnector.cs} (98%) rename OpenSim/Region/CoreModules/World/Estate/{XEstateModule.cs => EstateModule.cs} (99%) rename OpenSim/Region/CoreModules/World/Estate/{XEstateRequestHandler.cs => EstateRequestHandler.cs} (98%) diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs similarity index 98% rename from OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs rename to OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs index e56bd951da..ad561fd8ef 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateConnector.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs @@ -45,11 +45,11 @@ namespace OpenSim.Region.CoreModules.World.Estate { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected XEstateModule m_EstateModule; + protected EstateModule m_EstateModule; private string token; uint port = 0; - public EstateConnector(XEstateModule module, string _token, uint _port) + public EstateConnector(EstateModule module, string _token, uint _port) { m_EstateModule = module; token = _token; diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs similarity index 99% rename from OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs rename to OpenSim/Region/CoreModules/World/Estate/EstateModule.cs index f9438fe31b..8eb38c2aa8 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs @@ -45,7 +45,7 @@ using Mono.Addins; namespace OpenSim.Region.CoreModules.World.Estate { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "XEstate")] - public class XEstateModule : ISharedRegionModule + public class EstateModule : ISharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs similarity index 98% rename from OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs rename to OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs index 756b54dcb1..7ab92d1a47 100644 --- a/OpenSim/Region/CoreModules/World/Estate/XEstateRequestHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs @@ -46,11 +46,11 @@ namespace OpenSim.Region.CoreModules.World.Estate { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected XEstateModule m_EstateModule; + protected EstateModule m_EstateModule; protected Object m_RequestLock = new Object(); private string token; - public EstateRequestHandler(XEstateModule fmodule, string _token) + public EstateRequestHandler(EstateModule fmodule, string _token) : base("POST", "/estate") { m_EstateModule = fmodule; From de16ce35a38c4c19997951d2efce2dbbc20f6e0b Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 18:05:06 +0000 Subject: [PATCH 2/2] Make the estate communications handler selectable Still defaults to the core EstateModule if not configured differently --- .../CoreModules/World/Estate/EstateModule.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs index 8eb38c2aa8..fb4d04f45f 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs @@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Estate protected List m_Scenes = new List(); protected bool m_InInfoUpdate = false; private string token = "7db8eh2gvgg45jj"; + protected bool m_enabled = false; public bool InInfoUpdate { @@ -73,10 +74,19 @@ namespace OpenSim.Region.CoreModules.World.Estate IConfig estateConfig = config.Configs["Estates"]; if (estateConfig != null) { + if (estateConfig.GetString("EstateCommunicationsHandler", Name) == Name) + m_enabled = true; + else + return; + port = (uint)estateConfig.GetInt("Port", 0); // this will need to came from somewhere else token = estateConfig.GetString("Token", token); } + else + { + m_enabled = true; + } m_EstateConnector = new EstateConnector(this, token, port); @@ -98,12 +108,18 @@ namespace OpenSim.Region.CoreModules.World.Estate public void AddRegion(Scene scene) { + if (!m_enabled) + return; + lock (m_Scenes) m_Scenes.Add(scene); } public void RegionLoaded(Scene scene) { + if (!m_enabled) + return; + IEstateModule em = scene.RequestModuleInterface(); em.OnRegionInfoChange += OnRegionInfoChange; @@ -115,6 +131,9 @@ namespace OpenSim.Region.CoreModules.World.Estate public void RemoveRegion(Scene scene) { + if (!m_enabled) + return; + lock (m_Scenes) m_Scenes.Remove(scene); }