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