aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2009-04-14 03:22:02 +0000
committerMelanie Thielker2009-04-14 03:22:02 +0000
commit285dfe305550dc3f47f934ef96ae0c1b0b87aa60 (patch)
treeaf3f69e3db42e527b43e3e9621a76da87c39bbee /OpenSim
parentThis was needed for the prior commit. (diff)
downloadopensim-SC-285dfe305550dc3f47f934ef96ae0c1b0b87aa60.zip
opensim-SC-285dfe305550dc3f47f934ef96ae0c1b0b87aa60.tar.gz
opensim-SC-285dfe305550dc3f47f934ef96ae0c1b0b87aa60.tar.bz2
opensim-SC-285dfe305550dc3f47f934ef96ae0c1b0b87aa60.tar.xz
Add the RegionLoaded(Scene) API to the new region module interface to allow
region modules to use another region module's interfaces and events in a scene context
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs20
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs13
3 files changed, 37 insertions, 0 deletions
diff --git a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
index 49a400a..1914120 100644
--- a/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RegionModulesController/RegionModulesControllerPlugin.cs
@@ -174,6 +174,26 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
174 module.AddRegion(scene); 174 module.AddRegion(scene);
175 scene.AddRegionModule(module.Name, module); 175 scene.AddRegionModule(module.Name, module);
176 } 176 }
177
178 // This is needed for all module types. Modules will register
179 // Interfaces with scene in AddScene, and will also need a means
180 // to access interfaces registered by other modules. Without
181 // this extra method, a module attempting to use another modules's
182 // interface would be successful only depending on load order,
183 // which can't be depended upon, or modules would need to resort
184 // to ugly kludges to attempt to request interfaces when needed
185 // and unneccessary caching logic repeated in all modules.
186 // The extra function stub is just that much cleaner
187 //
188 foreach (ISharedRegionModule module in m_sharedInstances)
189 {
190 module.RegionLoaded(scene);
191 }
192
193 foreach (INonSharedRegionModule module in list)
194 {
195 module.RegionLoaded(scene);
196 }
177 } 197 }
178 198
179 public void RemoveRegionFromModules (Scene scene) 199 public void RemoveRegionFromModules (Scene scene)
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
index 9f1867f..5893a11 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs
@@ -136,6 +136,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
136 LoadPlugins(); 136 LoadPlugins();
137 } 137 }
138 138
139 public void RegionLoaded(Scene scene)
140 {
141 }
142
139 public void RemoveRegion(Scene scene) 143 public void RemoveRegion(Scene scene)
140 { 144 {
141 lock (m_scene) 145 lock (m_scene)
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs b/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs
index 265b464..9d2327a 100644
--- a/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs
+++ b/OpenSim/Region/Framework/Interfaces/IRegionModuleBase.cs
@@ -71,6 +71,19 @@ namespace OpenSim.Region.Framework.Interfaces
71 /// A <see cref="Scene"/> 71 /// A <see cref="Scene"/>
72 /// </param> 72 /// </param>
73 void RemoveRegion(Scene scene); 73 void RemoveRegion(Scene scene);
74
75 /// <summary>
76 /// This will be called once for every scene loaded. In a shared module
77 /// this will be multiple times in one instance, while a nonshared
78 /// module instance will only be called once.
79 /// This method is called after AddRegion has been called in all
80 /// modules for that scene, providing an opportunity to request
81 /// another module's interface, or hook an event from another module.
82 /// </summary>
83 /// <param name="scene">
84 /// A <see cref="Scene"/>
85 /// </param>
86 void RegionLoaded(Scene scene);
74 } 87 }
75 88
76} 89}