diff options
author | UbitUmarov | 2018-01-25 00:55:34 +0000 |
---|---|---|
committer | UbitUmarov | 2018-01-25 00:55:34 +0000 |
commit | 3aff72e403b132d030a18b42252ad426f7ce39be (patch) | |
tree | 78b4572e80fd5810dcb34df106ed1f480f4b0d70 | |
parent | cleanup a bit more (diff) | |
download | opensim-SC-3aff72e403b132d030a18b42252ad426f7ce39be.zip opensim-SC-3aff72e403b132d030a18b42252ad426f7ce39be.tar.gz opensim-SC-3aff72e403b132d030a18b42252ad426f7ce39be.tar.bz2 opensim-SC-3aff72e403b132d030a18b42252ad426f7ce39be.tar.xz |
change DataSnapeShoot init again. May still fail on multi regions instances
-rw-r--r-- | OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs index 58e6765..fd841d4 100644 --- a/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs | |||
@@ -159,10 +159,39 @@ namespace OpenSim.Region.DataSnapshot | |||
159 | if (!m_enabled) | 159 | if (!m_enabled) |
160 | return; | 160 | return; |
161 | 161 | ||
162 | m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName); | ||
163 | |||
164 | m_scenes.Add(scene); | 162 | m_scenes.Add(scene); |
165 | 163 | ||
164 | if (m_snapStore == null) | ||
165 | { | ||
166 | m_hostname = scene.RegionInfo.ExternalHostName; | ||
167 | m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); | ||
168 | } | ||
169 | |||
170 | m_snapStore.AddScene(scene); | ||
171 | |||
172 | Assembly currentasm = Assembly.GetExecutingAssembly(); | ||
173 | |||
174 | foreach (Type pluginType in currentasm.GetTypes()) | ||
175 | { | ||
176 | if (pluginType.IsPublic) | ||
177 | { | ||
178 | if (!pluginType.IsAbstract) | ||
179 | { | ||
180 | if (pluginType.GetInterface("IDataSnapshotProvider") != null) | ||
181 | { | ||
182 | IDataSnapshotProvider module = (IDataSnapshotProvider)Activator.CreateInstance(pluginType); | ||
183 | module.Initialize(scene, this); | ||
184 | module.OnStale += MarkDataStale; | ||
185 | |||
186 | m_dataproviders.Add(module); | ||
187 | m_snapStore.AddProvider(module); | ||
188 | |||
189 | m_log.Debug("[DATASNAPSHOT]: Added new data provider type: " + pluginType.Name); | ||
190 | } | ||
191 | } | ||
192 | } | ||
193 | } | ||
194 | m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName); | ||
166 | } | 195 | } |
167 | 196 | ||
168 | public void RemoveRegion(Scene scene) | 197 | public void RemoveRegion(Scene scene) |
@@ -205,42 +234,11 @@ namespace OpenSim.Region.DataSnapshot | |||
205 | if (!m_enabled) | 234 | if (!m_enabled) |
206 | return; | 235 | return; |
207 | 236 | ||
208 | if (m_snapStore == null) | 237 | if (!m_servicesNotified) |
209 | { | 238 | { |
210 | m_hostname = scene.RegionInfo.ExternalHostName; | ||
211 | m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); | ||
212 | |||
213 | //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer | 239 | //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer |
214 | new DataRequestHandler(scene, this); | 240 | new DataRequestHandler(scene, this); |
215 | } | ||
216 | |||
217 | m_snapStore.AddScene(scene); | ||
218 | 241 | ||
219 | Assembly currentasm = Assembly.GetExecutingAssembly(); | ||
220 | |||
221 | foreach (Type pluginType in currentasm.GetTypes()) | ||
222 | { | ||
223 | if (pluginType.IsPublic) | ||
224 | { | ||
225 | if (!pluginType.IsAbstract) | ||
226 | { | ||
227 | if (pluginType.GetInterface("IDataSnapshotProvider") != null) | ||
228 | { | ||
229 | IDataSnapshotProvider module = (IDataSnapshotProvider)Activator.CreateInstance(pluginType); | ||
230 | module.Initialize(scene, this); | ||
231 | module.OnStale += MarkDataStale; | ||
232 | |||
233 | m_dataproviders.Add(module); | ||
234 | m_snapStore.AddProvider(module); | ||
235 | |||
236 | m_log.Debug("[DATASNAPSHOT]: Added new data provider type: " + pluginType.Name); | ||
237 | } | ||
238 | } | ||
239 | } | ||
240 | } | ||
241 | |||
242 | if (!m_servicesNotified) | ||
243 | { | ||
244 | if (m_dataServices != "" && m_dataServices != "noservices") | 242 | if (m_dataServices != "" && m_dataServices != "noservices") |
245 | NotifyDataServices(m_dataServices, "online"); | 243 | NotifyDataServices(m_dataServices, "online"); |
246 | 244 | ||