diff options
Diffstat (limited to 'OpenSim/Region/DataSnapshot/DataSnapshotManager.cs')
-rw-r--r-- | OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 55 |
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; | |||
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Xml; | 34 | using System.Xml; |
35 | using log4net; | 35 | using log4net; |
36 | using Mono.Addins; | ||
37 | using Nini.Config; | 36 | using Nini.Config; |
38 | using OpenMetaverse; | 37 | using OpenMetaverse; |
39 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
@@ -44,8 +43,7 @@ using OpenSim.Region.Framework.Scenes; | |||
44 | 43 | ||
45 | namespace OpenSim.Region.DataSnapshot | 44 | namespace 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 |