diff options
author | Melanie Thielker | 2009-02-10 23:15:48 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-02-10 23:15:48 +0000 |
commit | 9bfbfa381abc92f3c5fc8e97405943128c85c5d4 (patch) | |
tree | 06248d4262cfd0e053010d6b8b6a19b8f6db2d40 /OpenSim/Region/Framework/Scenes/SceneBase.cs | |
parent | Fixes the problem of attachment offset after crossings/TPs. Hopefully it fixe... (diff) | |
download | opensim-SC-9bfbfa381abc92f3c5fc8e97405943128c85c5d4.zip opensim-SC-9bfbfa381abc92f3c5fc8e97405943128c85c5d4.tar.gz opensim-SC-9bfbfa381abc92f3c5fc8e97405943128c85c5d4.tar.bz2 opensim-SC-9bfbfa381abc92f3c5fc8e97405943128c85c5d4.tar.xz |
Add proper handling for shared vs. unshared modules to the command
interface. Shared modules will now only get added once, so the command
handler is called once per module, not once per scene. Removal of scenes
has no adverse effects. Nonshared modules will be called for each scene.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneBase.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index b0f328d..3f5c781 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -460,11 +460,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
460 | } | 460 | } |
461 | } | 461 | } |
462 | 462 | ||
463 | public void AddCommand(string module, string command, string shorthelp, string longhelp, CommandDelegate callback) | 463 | public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) |
464 | { | 464 | { |
465 | if (MainConsole.Instance == null) | 465 | if (MainConsole.Instance == null) |
466 | return; | 466 | return; |
467 | MainConsole.Instance.Commands.AddCommand(module, command, shorthelp, longhelp, callback); | 467 | |
468 | string modulename = String.Empty; | ||
469 | bool shared = false; | ||
470 | |||
471 | if (mod != null) | ||
472 | { | ||
473 | if (!(mod is IRegionModule)) | ||
474 | throw new Exception("AddCommand module parameter must be IRegionModule"); | ||
475 | IRegionModule module = (IRegionModule)mod; | ||
476 | modulename = module.Name; | ||
477 | shared = module.IsSharedModule; | ||
478 | } | ||
479 | |||
480 | MainConsole.Instance.Commands.AddCommand(modulename, shared, command, shorthelp, longhelp, callback); | ||
468 | } | 481 | } |
469 | } | 482 | } |
470 | } | 483 | } |