diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 6d61e9f..e58d3ce 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -61,17 +61,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
61 | /// <value> | 61 | /// <value> |
62 | /// The module interfaces available from this scene. | 62 | /// The module interfaces available from this scene. |
63 | /// </value> | 63 | /// </value> |
64 | protected Dictionary<Type, List<object> > ModuleInterfaces = new Dictionary<Type, List<object> >(); | 64 | protected Dictionary<Type, List<object>> ModuleInterfaces = new Dictionary<Type, List<object>>(); |
65 | 65 | ||
66 | protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); | 66 | protected Dictionary<string, object> ModuleAPIMethods = new Dictionary<string, object>(); |
67 | |||
68 | /// <value> | ||
69 | /// The module commanders available from this scene | ||
70 | /// </value> | ||
67 | protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>(); | 71 | protected Dictionary<string, ICommander> m_moduleCommanders = new Dictionary<string, ICommander>(); |
68 | 72 | ||
69 | /// <value> | 73 | /// <value> |
74 | /// The module commands available for this scene | ||
75 | /// </value> | ||
76 | protected Dictionary<string, ICommand> m_moduleCommands = new Dictionary<string, ICommand>(); | ||
77 | |||
78 | /// <value> | ||
70 | /// Registered classes that are capable of creating entities. | 79 | /// Registered classes that are capable of creating entities. |
71 | /// </value> | 80 | /// </value> |
72 | protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); | 81 | protected Dictionary<PCode, IEntityCreator> m_entityCreators = new Dictionary<PCode, IEntityCreator>(); |
73 | |||
74 | //API module interfaces | ||
75 | 82 | ||
76 | /// <summary> | 83 | /// <summary> |
77 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is | 84 | /// The last allocated local prim id. When a new local id is requested, the next number in the sequence is |
@@ -278,11 +285,47 @@ namespace OpenSim.Region.Framework.Scenes | |||
278 | } | 285 | } |
279 | } | 286 | } |
280 | 287 | ||
288 | /// <summary> | ||
289 | /// Register a module commander. | ||
290 | /// </summary> | ||
291 | /// <param name="commander"></param> | ||
281 | public void RegisterModuleCommander(ICommander commander) | 292 | public void RegisterModuleCommander(ICommander commander) |
282 | { | 293 | { |
283 | lock (m_moduleCommanders) | 294 | lock (m_moduleCommanders) |
284 | { | 295 | { |
285 | m_moduleCommanders.Add(commander.Name, commander); | 296 | m_moduleCommanders.Add(commander.Name, commander); |
297 | |||
298 | lock (m_moduleCommands) | ||
299 | { | ||
300 | foreach (ICommand command in commander.Commands.Values) | ||
301 | { | ||
302 | if (m_moduleCommands.ContainsKey(command.Name)) | ||
303 | { | ||
304 | m_log.ErrorFormat( | ||
305 | "[MODULES]: Module commander {0} tried to register the command {1} which has already been registered", | ||
306 | commander.Name, command.Name); | ||
307 | continue; | ||
308 | } | ||
309 | |||
310 | m_moduleCommands[command.Name] = command; | ||
311 | } | ||
312 | } | ||
313 | } | ||
314 | } | ||
315 | |||
316 | /// <summary> | ||
317 | /// Get an available module command | ||
318 | /// </summary> | ||
319 | /// <param name="commandName"></param> | ||
320 | /// <returns>The command if it was found, null if no command is available with that name</returns> | ||
321 | public ICommand GetCommand(string commandName) | ||
322 | { | ||
323 | lock (m_moduleCommands) | ||
324 | { | ||
325 | if (m_moduleCommands.ContainsKey(commandName)) | ||
326 | return m_moduleCommands[commandName]; | ||
327 | else | ||
328 | return null; | ||
286 | } | 329 | } |
287 | } | 330 | } |
288 | 331 | ||