aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/DataSnapshot
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/DataSnapshot')
-rw-r--r--OpenSim/Region/DataSnapshot/DataSnapshotManager.cs55
1 files changed, 33 insertions, 22 deletions
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;
33using System.Reflection; 33using System.Reflection;
34using System.Xml; 34using System.Xml;
35using log4net; 35using log4net;
36using Mono.Addins;
36using Nini.Config; 37using Nini.Config;
37using OpenMetaverse; 38using OpenMetaverse;
38using OpenSim.Framework; 39using OpenSim.Framework;
@@ -43,7 +44,8 @@ using OpenSim.Region.Framework.Scenes;
43 44
44namespace OpenSim.Region.DataSnapshot 45namespace OpenSim.Region.DataSnapshot
45{ 46{
46 public class DataSnapshotManager : IRegionModule, IDataSnapshot 47 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
48 public class DataSnapshotManager : ISharedRegionModule, IDataSnapshot
47 { 49 {
48 #region Class members 50 #region Class members
49 //Information from config 51 //Information from config
@@ -89,7 +91,7 @@ namespace OpenSim.Region.DataSnapshot
89 91
90 #region IRegionModule 92 #region IRegionModule
91 93
92 public void Initialise(Scene scene, IConfigSource config) 94 public void Initialise(IConfigSource config)
93 { 95 {
94 if (!m_configLoaded) 96 if (!m_configLoaded)
95 { 97 {
@@ -140,24 +142,29 @@ namespace OpenSim.Region.DataSnapshot
140 return; 142 return;
141 } 143 }
142 } 144 }
145 }
146 }
143 147
144 if (m_enabled) 148 public Type ReplaceableInterface
145 { 149 {
146 //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer 150 get { return null; }
147 new DataRequestHandler(scene, this); 151 }
148 152
149 m_hostname = scene.RegionInfo.ExternalHostName; 153 public void AddRegion(Scene scene)
150 m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); 154 {
155 if (m_enabled)
156 {
157 //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer
158 new DataRequestHandler(scene, this);
151 159
152 MakeEverythingStale(); 160 m_hostname = scene.RegionInfo.ExternalHostName;
161 m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname);
153 162
154 if (m_dataServices != "" && m_dataServices != "noservices") 163 MakeEverythingStale();
155 NotifyDataServices(m_dataServices, "online"); 164
156 } 165 if (m_dataServices != "" && m_dataServices != "noservices")
157 } 166 NotifyDataServices(m_dataServices, "online");
158 167
159 if (m_enabled)
160 {
161 m_log.Info("[DATASNAPSHOT]: Scene added to module."); 168 m_log.Info("[DATASNAPSHOT]: Scene added to module.");
162 169
163 m_snapStore.AddScene(scene); 170 m_snapStore.AddScene(scene);
@@ -191,20 +198,25 @@ namespace OpenSim.Region.DataSnapshot
191 } 198 }
192 else 199 else
193 { 200 {
194 m_log.Warn("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else)."); 201 m_log.Info("[DATASNAPSHOT]: Data snapshot disabled, not adding scene to module (or anything else).");
195 } 202 }
196 } 203 }
197 204
198 public void Close() 205 public void RegionLoaded(Scene scene)
199 { 206 {
200 if (m_enabled && m_dataServices != "" && m_dataServices != "noservices")
201 NotifyDataServices(m_dataServices, "offline");
202 } 207 }
203 208
209 public void RemoveRegion(Scene scene)
210 {
211 if (m_scenes.Contains(scene))
212 m_scenes.Remove(scene);
213 m_snapStore.RemoveScene(scene);
214 }
204 215
205 public bool IsSharedModule 216 public void Close()
206 { 217 {
207 get { return true; } 218 if (m_enabled && m_dataServices != "" && m_dataServices != "noservices")
219 NotifyDataServices(m_dataServices, "offline");
208 } 220 }
209 221
210 public string Name 222 public string Name
@@ -214,7 +226,6 @@ namespace OpenSim.Region.DataSnapshot
214 226
215 public void PostInitialise() 227 public void PostInitialise()
216 { 228 {
217
218 } 229 }
219 230
220 #endregion 231 #endregion