diff options
author | MW | 2009-02-26 22:51:52 +0000 |
---|---|---|
committer | MW | 2009-02-26 22:51:52 +0000 |
commit | 756c5170694fa3dc4146c2b4034f52bd5c97ec86 (patch) | |
tree | 2390934b9e8544e332d55ff7a9a513424612914a | |
parent | This adds a new osGetAgentIP function with threat level set to High. It (diff) | |
download | opensim-SC-756c5170694fa3dc4146c2b4034f52bd5c97ec86.zip opensim-SC-756c5170694fa3dc4146c2b4034f52bd5c97ec86.tar.gz opensim-SC-756c5170694fa3dc4146c2b4034f52bd5c97ec86.tar.bz2 opensim-SC-756c5170694fa3dc4146c2b4034f52bd5c97ec86.tar.xz |
Added IRegionCreator interface that all ApplicationPlugins that are creators of Scenes should implement and register with the ApplicationRegistry.StackModuleInterface<>(); So that other plugins can attach to their OnNewRegionCreated event.
Made some changes to IRegistryCore and RegistryCore so they support "Stacked" interfaces.
-rw-r--r-- | OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs | 1 | ||||
-rw-r--r-- | OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/IRegionCreator.cs | 12 | ||||
-rw-r--r-- | OpenSim/Framework/IRegistryCore.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/RegistryCore.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 7 |
6 files changed, 34 insertions, 5 deletions
diff --git a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs index 0633e63..83c2426 100644 --- a/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs +++ b/OpenSim/ApplicationPlugins/CreateCommsManager/CreateCommsManagerPlugin.cs | |||
@@ -114,6 +114,7 @@ namespace OpenSim.ApplicationPlugins.CreateCommsManager | |||
114 | private void InitialiseCommsManager(OpenSimBase openSim) | 114 | private void InitialiseCommsManager(OpenSimBase openSim) |
115 | { | 115 | { |
116 | LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile); | 116 | LibraryRootFolder libraryRootFolder = new LibraryRootFolder(m_openSim.ConfigurationSettings.LibrariesXMLFile); |
117 | |||
117 | bool hgrid = m_openSim.ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false); | 118 | bool hgrid = m_openSim.ConfigSource.Source.Configs["Startup"].GetBoolean("hypergrid", false); |
118 | 119 | ||
119 | if (hgrid) | 120 | if (hgrid) |
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs index 962f7b3..4a6a6b1 100644 --- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs +++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs | |||
@@ -42,9 +42,7 @@ using OpenSim.Framework.Servers; | |||
42 | 42 | ||
43 | namespace OpenSim.ApplicationPlugins.LoadRegions | 43 | namespace OpenSim.ApplicationPlugins.LoadRegions |
44 | { | 44 | { |
45 | public delegate void NewRegionCreated(IScene scene); | 45 | public class LoadRegionsPlugin : IApplicationPlugin, IRegionCreator |
46 | |||
47 | public class LoadRegionsPlugin : IApplicationPlugin | ||
48 | { | 46 | { |
49 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
50 | 48 | ||
diff --git a/OpenSim/Framework/IRegionCreator.cs b/OpenSim/Framework/IRegionCreator.cs new file mode 100644 index 0000000..7920ee4 --- /dev/null +++ b/OpenSim/Framework/IRegionCreator.cs | |||
@@ -0,0 +1,12 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Framework | ||
6 | { | ||
7 | public delegate void NewRegionCreated(IScene scene); | ||
8 | public interface IRegionCreator | ||
9 | { | ||
10 | event NewRegionCreated OnNewRegionCreated; | ||
11 | } | ||
12 | } | ||
diff --git a/OpenSim/Framework/IRegistryCore.cs b/OpenSim/Framework/IRegistryCore.cs index 486dee6..9f251c5 100644 --- a/OpenSim/Framework/IRegistryCore.cs +++ b/OpenSim/Framework/IRegistryCore.cs | |||
@@ -4,10 +4,13 @@ using System.Text; | |||
4 | 4 | ||
5 | namespace OpenSim.Framework | 5 | namespace OpenSim.Framework |
6 | { | 6 | { |
7 | public interface IRegistryCore | 7 | public interface IRegistryCore |
8 | { | 8 | { |
9 | T Get<T>(); | 9 | T Get<T>(); |
10 | void RegisterInterface<T>(T iface); | 10 | void RegisterInterface<T>(T iface); |
11 | bool TryGet<T>(out T iface); | 11 | bool TryGet<T>(out T iface); |
12 | |||
13 | void StackModuleInterface<M>(M mod); | ||
14 | T[] RequestModuleInterfaces<T>(); | ||
12 | } | 15 | } |
13 | } | 16 | } |
diff --git a/OpenSim/Framework/RegistryCore.cs b/OpenSim/Framework/RegistryCore.cs index c703f9f..ee15845 100644 --- a/OpenSim/Framework/RegistryCore.cs +++ b/OpenSim/Framework/RegistryCore.cs | |||
@@ -40,5 +40,15 @@ namespace OpenSim.Framework | |||
40 | return (T)m_moduleInterfaces[typeof(T)]; | 40 | return (T)m_moduleInterfaces[typeof(T)]; |
41 | } | 41 | } |
42 | 42 | ||
43 | public void StackModuleInterface<M>(M mod) | ||
44 | { | ||
45 | |||
46 | } | ||
47 | |||
48 | public T[] RequestModuleInterfaces<T>() | ||
49 | { | ||
50 | return new T[] { default(T) }; | ||
51 | } | ||
52 | |||
43 | } | 53 | } |
44 | } | 54 | } |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 3f7c757..5927c5c 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -212,6 +212,12 @@ namespace OpenSim | |||
212 | m_commsManager.GridService.RegionLoginsEnabled = true; | 212 | m_commsManager.GridService.RegionLoginsEnabled = true; |
213 | } | 213 | } |
214 | 214 | ||
215 | AddPluginCommands(); | ||
216 | |||
217 | } | ||
218 | |||
219 | protected virtual void AddPluginCommands() | ||
220 | { | ||
215 | // If console exists add plugin commands. | 221 | // If console exists add plugin commands. |
216 | if (m_console != null) | 222 | if (m_console != null) |
217 | { | 223 | { |
@@ -251,7 +257,6 @@ namespace OpenSim | |||
251 | } | 257 | } |
252 | } | 258 | } |
253 | } | 259 | } |
254 | |||
255 | } | 260 | } |
256 | 261 | ||
257 | private void HandleCommanderCommand(string module, string[] cmd) | 262 | private void HandleCommanderCommand(string module, string[] cmd) |