diff options
Diffstat (limited to 'OpenSim/Tests/Common')
-rw-r--r-- | OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 35 |
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 | ||
28 | using System; | 28 | using System; |
29 | using System.Net; | 29 | using System.Net; |
30 | using System.Collections.Generic; | ||
30 | using Nini.Config; | 31 | using Nini.Config; |
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
32 | using OpenSim.Framework; | 33 | using 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(); |