move some code back to AddRegion because some tests dont issue RegionLoaded

LSLKeyTest
UbitUmarov 2016-07-30 23:23:28 +01:00
parent 7b55348360
commit 78d9312fc8
1 changed files with 18 additions and 13 deletions

View File

@ -60,9 +60,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
m_log.DebugFormat("{0} LocalGridServicesConnector no parms.", LogHeader); m_log.DebugFormat("{0} LocalGridServicesConnector no parms.", LogHeader);
} }
public LocalGridServicesConnector(IConfigSource source, RegionInfoCache regionInfoCache) public LocalGridServicesConnector(IConfigSource source)
{ {
m_log.DebugFormat("{0} LocalGridServicesConnector instantiated directly.", LogHeader); m_log.DebugFormat("{0} LocalGridServicesConnector instantiated directly.", LogHeader);
InitialiseService(source, null);
}
public LocalGridServicesConnector(IConfigSource source, RegionInfoCache regionInfoCache)
{
m_log.DebugFormat("{0} LocalGridServicesConnector instantiated directly witj cache.", LogHeader);
InitialiseService(source, regionInfoCache); InitialiseService(source, regionInfoCache);
} }
@ -148,6 +154,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return; return;
scene.RegisterModuleInterface<IGridService>(this); scene.RegisterModuleInterface<IGridService>(this);
// tests seem not to init this correctly, so brute force
if( m_RegionInfoCache == null)
m_RegionInfoCache = new RegionInfoCache();
GridRegion r = new GridRegion(scene.RegionInfo);
m_RegionInfoCache.CacheLocal(r);
scene.EventManager.OnRegionUp += OnRegionUp;
} }
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
@ -161,18 +178,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
public void RegionLoaded(Scene scene) public void RegionLoaded(Scene scene)
{ {
if (!m_Enabled)
return;
GridRegion r = new GridRegion(scene.RegionInfo);
// tests seem not to init this correctly, so brute force
if( m_RegionInfoCache == null)
m_RegionInfoCache = new RegionInfoCache();
m_RegionInfoCache.CacheLocal(r);
scene.EventManager.OnRegionUp += OnRegionUp;
} }
#endregion #endregion