change DataSnapeShoot init again. May still fail on multi regions instances

httptests
UbitUmarov 2018-01-25 00:55:34 +00:00
parent 22666ad18a
commit 3aff72e403
1 changed files with 34 additions and 36 deletions

View File

@ -159,10 +159,39 @@ namespace OpenSim.Region.DataSnapshot
if (!m_enabled) if (!m_enabled)
return; return;
m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName);
m_scenes.Add(scene); m_scenes.Add(scene);
if (m_snapStore == null)
{
m_hostname = scene.RegionInfo.ExternalHostName;
m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname);
}
m_snapStore.AddScene(scene);
Assembly currentasm = Assembly.GetExecutingAssembly();
foreach (Type pluginType in currentasm.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
if (pluginType.GetInterface("IDataSnapshotProvider") != null)
{
IDataSnapshotProvider module = (IDataSnapshotProvider)Activator.CreateInstance(pluginType);
module.Initialize(scene, this);
module.OnStale += MarkDataStale;
m_dataproviders.Add(module);
m_snapStore.AddProvider(module);
m_log.Debug("[DATASNAPSHOT]: Added new data provider type: " + pluginType.Name);
}
}
}
}
m_log.DebugFormat("[DATASNAPSHOT]: Module added to Scene {0}.", scene.RegionInfo.RegionName);
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
@ -205,42 +234,11 @@ namespace OpenSim.Region.DataSnapshot
if (!m_enabled) if (!m_enabled)
return; return;
if (m_snapStore == null)
{
m_hostname = scene.RegionInfo.ExternalHostName;
m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname);
//Hand it the first scene, assuming that all scenes have the same BaseHTTPServer
new DataRequestHandler(scene, this);
}
m_snapStore.AddScene(scene);
Assembly currentasm = Assembly.GetExecutingAssembly();
foreach (Type pluginType in currentasm.GetTypes())
{
if (pluginType.IsPublic)
{
if (!pluginType.IsAbstract)
{
if (pluginType.GetInterface("IDataSnapshotProvider") != null)
{
IDataSnapshotProvider module = (IDataSnapshotProvider)Activator.CreateInstance(pluginType);
module.Initialize(scene, this);
module.OnStale += MarkDataStale;
m_dataproviders.Add(module);
m_snapStore.AddProvider(module);
m_log.Debug("[DATASNAPSHOT]: Added new data provider type: " + pluginType.Name);
}
}
}
}
if (!m_servicesNotified) if (!m_servicesNotified)
{ {
//Hand it the first scene, assuming that all scenes have the same BaseHTTPServer
new DataRequestHandler(scene, this);
if (m_dataServices != "" && m_dataServices != "noservices") if (m_dataServices != "" && m_dataServices != "noservices")
NotifyDataServices(m_dataServices, "online"); NotifyDataServices(m_dataServices, "online");