aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Tests/Common/Helpers/SceneHelpers.cs')
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs44
1 files changed, 15 insertions, 29 deletions
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index 7598cc3..ea3e348 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -139,11 +139,11 @@ namespace OpenSim.Tests.Common
139 SceneCommunicationService scs = new SceneCommunicationService(); 139 SceneCommunicationService scs = new SceneCommunicationService();
140 140
141 TestScene testScene = new TestScene( 141 TestScene testScene = new TestScene(
142 regInfo, m_acm, scs, m_simDataService, m_estateDataService, null, false, configSource, null); 142 regInfo, m_acm, scs, m_simDataService, m_estateDataService, false, configSource, null);
143 143
144 IRegionModule godsModule = new GodsModule(); 144 INonSharedRegionModule godsModule = new GodsModule();
145 godsModule.Initialise(testScene, new IniConfigSource()); 145 godsModule.Initialise(new IniConfigSource());
146 testScene.AddModule(godsModule.Name, godsModule); 146 godsModule.AddRegion(testScene);
147 147
148 // Add scene to services 148 // Add scene to services
149 m_assetService.AddRegion(testScene); 149 m_assetService.AddRegion(testScene);
@@ -245,7 +245,7 @@ namespace OpenSim.Tests.Common
245 config.AddConfig("Modules"); 245 config.AddConfig("Modules");
246 config.AddConfig("InventoryService"); 246 config.AddConfig("InventoryService");
247 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector"); 247 config.Configs["Modules"].Set("InventoryServices", "LocalInventoryServicesConnector");
248 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:InventoryService"); 248 config.Configs["InventoryService"].Set("LocalServiceModule", "OpenSim.Services.InventoryService.dll:XInventoryService");
249 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); 249 config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll");
250 250
251 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector(); 251 LocalInventoryServicesConnector inventoryService = new LocalInventoryServicesConnector();
@@ -350,6 +350,10 @@ namespace OpenSim.Tests.Common
350 /// </summary> 350 /// </summary>
351 /// <remarks> 351 /// <remarks>
352 /// If called directly, then all the modules must be shared modules. 352 /// If called directly, then all the modules must be shared modules.
353 ///
354 /// We are emulating here the normal calls made to setup region modules
355 /// (Initialise(), PostInitialise(), AddRegion, RegionLoaded()).
356 /// TODO: Need to reuse normal runtime module code.
353 /// </remarks> 357 /// </remarks>
354 /// <param name="scenes"></param> 358 /// <param name="scenes"></param>
355 /// <param name="config"></param> 359 /// <param name="config"></param>
@@ -359,28 +363,10 @@ namespace OpenSim.Tests.Common
359 List<IRegionModuleBase> newModules = new List<IRegionModuleBase>(); 363 List<IRegionModuleBase> newModules = new List<IRegionModuleBase>();
360 foreach (object module in modules) 364 foreach (object module in modules)
361 { 365 {
362// Console.WriteLine("MODULE RAW {0}", module); 366 IRegionModuleBase m = (IRegionModuleBase)module;
363 if (module is IRegionModule) 367// Console.WriteLine("MODULE {0}", m.Name);
364 { 368 m.Initialise(config);
365 IRegionModule m = (IRegionModule)module; 369 newModules.Add(m);
366
367 foreach (Scene scene in scenes)
368 {
369 m.Initialise(scene, config);
370 scene.AddModule(m.Name, m);
371 }
372
373 m.PostInitialise();
374 }
375 else if (module is IRegionModuleBase)
376 {
377 // for the new system, everything has to be initialised first,
378 // shared modules have to be post-initialised, then all get an AddRegion with the scene
379 IRegionModuleBase m = (IRegionModuleBase)module;
380// Console.WriteLine("MODULE {0}", m.Name);
381 m.Initialise(config);
382 newModules.Add(m);
383 }
384 } 370 }
385 371
386 foreach (IRegionModuleBase module in newModules) 372 foreach (IRegionModuleBase module in newModules)
@@ -396,7 +382,7 @@ namespace OpenSim.Tests.Common
396 scene.AddRegionModule(module.Name, module); 382 scene.AddRegionModule(module.Name, module);
397 } 383 }
398 } 384 }
399 385
400 // RegionLoaded is fired after all modules have been appropriately added to all scenes 386 // RegionLoaded is fired after all modules have been appropriately added to all scenes
401 foreach (IRegionModuleBase module in newModules) 387 foreach (IRegionModuleBase module in newModules)
402 foreach (Scene scene in scenes) 388 foreach (Scene scene in scenes)
@@ -709,4 +695,4 @@ namespace OpenSim.Tests.Common
709 return sog; 695 return sog;
710 } 696 }
711 } 697 }
712} \ No newline at end of file 698}