From b717f991ede7f20fea4a3c331606a318f3300cb5 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Mon, 13 Apr 2009 21:23:24 +0000 Subject: Remove m_moduleCommands. It wasn't used anywhere; probably a left-over from before ICommander times --- OpenSim/Region/Framework/Scenes/SceneBase.cs | 39 ++++++---------------------- 1 file changed, 8 insertions(+), 31 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index 42f3d97..89b5d77 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs @@ -78,11 +78,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. /// protected Dictionary m_entityCreators = new Dictionary(); @@ -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); } } -- cgit v1.1