aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests
diff options
context:
space:
mode:
authorHomer Horwitz2009-04-13 21:23:33 +0000
committerHomer Horwitz2009-04-13 21:23:33 +0000
commit6db21bbf97b33bca017dcbc3b83687daa33f50b5 (patch)
treebc8244d0f3387ec9578f5c17eb2bf88603252cfb /OpenSim/Tests
parentRemove m_moduleCommands. It wasn't used anywhere; probably a left-over from b... (diff)
downloadopensim-SC-6db21bbf97b33bca017dcbc3b83687daa33f50b5.zip
opensim-SC-6db21bbf97b33bca017dcbc3b83687daa33f50b5.tar.gz
opensim-SC-6db21bbf97b33bca017dcbc3b83687daa33f50b5.tar.bz2
opensim-SC-6db21bbf97b33bca017dcbc3b83687daa33f50b5.tar.xz
- Moved TerrainModule to the new region-module system.
- Fixed some locking issues. Either lock, or don't (if you don't have to). Only locking access half of the time won't work reliably. - Had to adapt test helpers that use the "old" IRegionModule. TerrainModule isn't one anymore.
Diffstat (limited to 'OpenSim/Tests')
-rw-r--r--OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs35
1 files changed, 30 insertions, 5 deletions
diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
index d4c2daa..8f2f5a0 100644
--- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
+++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs
@@ -27,6 +27,7 @@
27 27
28using System; 28using System;
29using System.Net; 29using System.Net;
30using System.Collections.Generic;
30using Nini.Config; 31using Nini.Config;
31using OpenMetaverse; 32using OpenMetaverse;
32using OpenSim.Framework; 33using OpenSim.Framework;
@@ -109,7 +110,7 @@ namespace OpenSim.Tests.Common.Setup
109 /// </summary> 110 /// </summary>
110 /// <param name="scene"></param> 111 /// <param name="scene"></param>
111 /// <param name="modules"></param> 112 /// <param name="modules"></param>
112 public static void SetupSceneModules(Scene scene, params IRegionModule[] modules) 113 public static void SetupSceneModules(Scene scene, params object[] modules)
113 { 114 {
114 SetupSceneModules(scene, null, modules); 115 SetupSceneModules(scene, null, modules);
115 } 116 }
@@ -120,12 +121,36 @@ namespace OpenSim.Tests.Common.Setup
120 /// <param name="scene"></param> 121 /// <param name="scene"></param>
121 /// <param name="config"></param> 122 /// <param name="config"></param>
122 /// <param name="modules"></param> 123 /// <param name="modules"></param>
123 public static void SetupSceneModules(Scene scene, IConfigSource config, params IRegionModule[] modules) 124 public static void SetupSceneModules(Scene scene, IConfigSource config, params object[] modules)
124 { 125 {
125 foreach (IRegionModule module in modules) 126 List<IRegionModuleBase> newModules = new List<IRegionModuleBase>();
127 foreach (object module in modules)
126 { 128 {
127 module.Initialise(scene, config); 129 if (module is IRegionModule)
128 scene.AddModule(module.Name, module); 130 {
131 IRegionModule m = (IRegionModule)module;
132 m.Initialise(scene, config);
133 scene.AddModule(m.Name, m);
134 }
135 else if(module is IRegionModuleBase)
136 {
137 // for the new system, everything has to be initialised first,
138 // shared modules have to be post-initialised, then all get an AddRegion with the scene
139 IRegionModuleBase m = (IRegionModuleBase)module;
140 m.Initialise(config);
141 newModules.Add(m);
142 }
143 }
144
145 foreach (IRegionModuleBase module in newModules)
146 {
147 if (module is ISharedRegionModule) ((ISharedRegionModule)module).PostInitialise();
148 }
149
150 foreach (IRegionModuleBase module in newModules)
151 {
152 module.AddRegion(scene);
153 scene.AddRegionModule(module.Name, module);
129 } 154 }
130 155
131 scene.SetModuleInterfaces(); 156 scene.SetModuleInterfaces();