From 6db21bbf97b33bca017dcbc3b83687daa33f50b5 Mon Sep 17 00:00:00 2001
From: Homer Horwitz
Date: Mon, 13 Apr 2009 21:23:33 +0000
Subject: - 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.
---
OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 35 +++++++++++++++++++++----
1 file changed, 30 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs')
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 @@
using System;
using System.Net;
+using System.Collections.Generic;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
@@ -109,7 +110,7 @@ namespace OpenSim.Tests.Common.Setup
///
///
///
- public static void SetupSceneModules(Scene scene, params IRegionModule[] modules)
+ public static void SetupSceneModules(Scene scene, params object[] modules)
{
SetupSceneModules(scene, null, modules);
}
@@ -120,12 +121,36 @@ namespace OpenSim.Tests.Common.Setup
///
///
///
- public static void SetupSceneModules(Scene scene, IConfigSource config, params IRegionModule[] modules)
+ public static void SetupSceneModules(Scene scene, IConfigSource config, params object[] modules)
{
- foreach (IRegionModule module in modules)
+ List newModules = new List();
+ foreach (object module in modules)
{
- module.Initialise(scene, config);
- scene.AddModule(module.Name, module);
+ if (module is IRegionModule)
+ {
+ IRegionModule m = (IRegionModule)module;
+ m.Initialise(scene, config);
+ scene.AddModule(m.Name, m);
+ }
+ else if(module is IRegionModuleBase)
+ {
+ // for the new system, everything has to be initialised first,
+ // shared modules have to be post-initialised, then all get an AddRegion with the scene
+ IRegionModuleBase m = (IRegionModuleBase)module;
+ m.Initialise(config);
+ newModules.Add(m);
+ }
+ }
+
+ foreach (IRegionModuleBase module in newModules)
+ {
+ if (module is ISharedRegionModule) ((ISharedRegionModule)module).PostInitialise();
+ }
+
+ foreach (IRegionModuleBase module in newModules)
+ {
+ module.AddRegion(scene);
+ scene.AddRegionModule(module.Name, module);
}
scene.SetModuleInterfaces();
--
cgit v1.1