diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 42f3d971be..89b5d77d95 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -77,11 +77,6 @@ namespace OpenSim.Region.Framework.Scenes /// protected Dictionary m_moduleCommanders = new Dictionary(); - /// - /// The module commands available for this scene - /// - protected Dictionary m_moduleCommands = new Dictionary(); - /// /// Registered classes that are capable of creating entities. /// @@ -311,38 +306,20 @@ namespace OpenSim.Region.Framework.Scenes lock (m_moduleCommanders) { m_moduleCommanders.Add(commander.Name, commander); - - lock (m_moduleCommands) - { - foreach (ICommand command in commander.Commands.Values) - { - if (m_moduleCommands.ContainsKey(command.Name)) - { - m_log.ErrorFormat( - "[MODULES]: Module commander {0} tried to register the command {1} which has already been registered", - commander.Name, command.Name); - continue; - } - - m_moduleCommands[command.Name] = command; - } - } } } - + /// - /// Get an available module command + /// Unregister a module commander and all its commands /// - /// - /// The command if it was found, null if no command is available with that name - public ICommand GetCommand(string commandName) + /// + public void UnregisterModuleCommander(string name) { - lock (m_moduleCommands) + lock (m_moduleCommanders) { - if (m_moduleCommands.ContainsKey(commandName)) - return m_moduleCommands[commandName]; - else - return null; + ICommander commander; + if (m_moduleCommanders.TryGetValue(name, out commander)) + m_moduleCommanders.Remove(name); } }