From ec3c31e61e5e540f822891110df9bc978655bbaf Mon Sep 17 00:00:00 2001 From: Revolution Date: Fri, 22 Jan 2010 18:09:33 -0600 Subject: Updates all IRegionModules to the new style region modules. Signed-off-by: Melanie --- OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 55 +++++++++++++--------- 1 file changed, 33 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region/DataSnapshot') diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index 4df9094..b0cefc3 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -33,6 +33,7 @@ using System.Net; using System.Reflection; using System.Xml; using log4net; +using Mono.Addins; using Nini.Config; using OpenMetaverse; using OpenSim.Framework; @@ -43,7 +44,8 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.DataSnapshot { - public class DataSnapshotManager : IRegionModule, IDataSnapshot + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class DataSnapshotManager : ISharedRegionModule, IDataSnapshot { #region Class members //Information from config @@ -89,7 +91,7 @@ namespace OpenSim.Region.DataSnapshot #region IRegionModule - public void Initialise(Scene scene, IConfigSource config) + public void Initialise(IConfigSource config) { if (!m_configLoaded) { @@ -140,24 +142,29 @@ namespace OpenSim.Region.DataSnapshot return; } } + } + } - if (m_enabled) - { - //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer - new DataRequestHandler(scene, this); + public Type ReplaceableInterface + { + get { return null; } + } - m_hostname = scene.RegionInfo.ExternalHostName; - m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); + public void AddRegion(Scene scene) + { + if (m_enabled) + { + //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer + new DataRequestHandler(scene, this); - MakeEverythingStale(); + m_hostname = scene.RegionInfo.ExternalHostName; + m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); - if (m_dataServices != "" && m_dataServices != "noservices") - NotifyDataServices(m_dataServices, "online"); - } - } + MakeEverythingStale(); + + if (m_dataServices != "" && m_dataServices != "noservices") + NotifyDataServices(m_dataServices, "online"); - if (m_enabled) - { m_log.Info("[DATASNAPSHOT]: Scene added to module."); m_snapStore.AddScene(scene); @@ -191,20 +198,25 @@ namespace OpenSim.Region.DataSnapshot } else { - m_log.Warn("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else)."); + m_log.Info("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else)."); } } - public void Close() + public void RegionLoaded(Scene scene) { - if (m_enabled && m_dataServices != "" && m_dataServices != "noservices") - NotifyDataServices(m_dataServices, "offline"); } + public void RemoveRegion(Scene scene) + { + if (m_scenes.Contains(scene)) + m_scenes.Remove(scene); + m_snapStore.RemoveScene(scene); + } - public bool IsSharedModule + public void Close() { - get { return true; } + if (m_enabled && m_dataServices != "" && m_dataServices != "noservices") + NotifyDataServices(m_dataServices, "offline"); } public string Name @@ -214,7 +226,6 @@ namespace OpenSim.Region.DataSnapshot public void PostInitialise() { - } #endregion -- cgit v1.1