aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneBase.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs80
1 files changed, 11 insertions, 69 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 7c8bd88..74c9582 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -67,12 +67,6 @@ namespace OpenSim.Region.Framework.Scenes
67 /// <value> 67 /// <value>
68 /// All the region modules attached to this scene. 68 /// All the region modules attached to this scene.
69 /// </value> 69 /// </value>
70 public Dictionary<string, IRegionModule> Modules
71 {
72 get { return m_modules; }
73 }
74 protected Dictionary<string, IRegionModule> m_modules = new Dictionary<string, IRegionModule>();
75
76 public Dictionary<string, IRegionModuleBase> RegionModules 70 public Dictionary<string, IRegionModuleBase> RegionModules
77 { 71 {
78 get { return m_regionModules; } 72 get { return m_regionModules; }
@@ -273,16 +267,6 @@ namespace OpenSim.Region.Framework.Scenes
273 /// </summary> 267 /// </summary>
274 public virtual void Close() 268 public virtual void Close()
275 { 269 {
276 // Shut down all non shared modules.
277 foreach (IRegionModule module in Modules.Values)
278 {
279 if (!module.IsSharedModule)
280 {
281 module.Close();
282 }
283 }
284 Modules.Clear();
285
286 try 270 try
287 { 271 {
288 EventManager.TriggerShutdown(); 272 EventManager.TriggerShutdown();
@@ -313,19 +297,6 @@ namespace OpenSim.Region.Framework.Scenes
313 #region Module Methods 297 #region Module Methods
314 298
315 /// <summary> 299 /// <summary>
316 /// Add a module to this scene.
317 /// </summary>
318 /// <param name="name"></param>
319 /// <param name="module"></param>
320 public void AddModule(string name, IRegionModule module)
321 {
322 if (!Modules.ContainsKey(name))
323 {
324 Modules.Add(name, module);
325 }
326 }
327
328 /// <summary>
329 /// Add a region-module to this scene. TODO: This will replace AddModule in the future. 300 /// Add a region-module to this scene. TODO: This will replace AddModule in the future.
330 /// </summary> 301 /// </summary>
331 /// <param name="name"></param> 302 /// <param name="name"></param>
@@ -509,9 +480,9 @@ namespace OpenSim.Region.Framework.Scenes
509 /// <param name="shorthelp"></param> 480 /// <param name="shorthelp"></param>
510 /// <param name="longhelp"></param> 481 /// <param name="longhelp"></param>
511 /// <param name="callback"></param> 482 /// <param name="callback"></param>
512 public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) 483 public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback)
513 { 484 {
514 AddCommand(mod, command, shorthelp, longhelp, string.Empty, callback); 485 AddCommand(module, command, shorthelp, longhelp, string.Empty, callback);
515 } 486 }
516 487
517 /// <summary> 488 /// <summary>
@@ -529,9 +500,9 @@ namespace OpenSim.Region.Framework.Scenes
529 /// <param name="longhelp"></param> 500 /// <param name="longhelp"></param>
530 /// <param name="callback"></param> 501 /// <param name="callback"></param>
531 public void AddCommand( 502 public void AddCommand(
532 string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) 503 string category, IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback)
533 { 504 {
534 AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback); 505 AddCommand(category, module, command, shorthelp, longhelp, string.Empty, callback);
535 } 506 }
536 507
537 /// <summary> 508 /// <summary>
@@ -543,29 +514,14 @@ namespace OpenSim.Region.Framework.Scenes
543 /// <param name="longhelp"></param> 514 /// <param name="longhelp"></param>
544 /// <param name="descriptivehelp"></param> 515 /// <param name="descriptivehelp"></param>
545 /// <param name="callback"></param> 516 /// <param name="callback"></param>
546 public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) 517 public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
547 { 518 {
548 string moduleName = ""; 519 string moduleName = "";
549 520
550 if (mod != null) 521 if (module != null)
551 { 522 moduleName = module.Name;
552 if (mod is IRegionModule)
553 {
554 IRegionModule module = (IRegionModule)mod;
555 moduleName = module.Name;
556 }
557 else if (mod is IRegionModuleBase)
558 {
559 IRegionModuleBase module = (IRegionModuleBase)mod;
560 moduleName = module.Name;
561 }
562 else
563 {
564 throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
565 }
566 }
567 523
568 AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback); 524 AddCommand(moduleName, module, command, shorthelp, longhelp, descriptivehelp, callback);
569 } 525 }
570 526
571 /// <summary> 527 /// <summary>
@@ -581,7 +537,7 @@ namespace OpenSim.Region.Framework.Scenes
581 /// <param name="descriptivehelp"></param> 537 /// <param name="descriptivehelp"></param>
582 /// <param name="callback"></param> 538 /// <param name="callback"></param>
583 public void AddCommand( 539 public void AddCommand(
584 string category, object mod, string command, 540 string category, IRegionModuleBase module, string command,
585 string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) 541 string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
586 { 542 {
587 if (MainConsole.Instance == null) 543 if (MainConsole.Instance == null)
@@ -589,22 +545,8 @@ namespace OpenSim.Region.Framework.Scenes
589 545
590 bool shared = false; 546 bool shared = false;
591 547
592 if (mod != null) 548 if (module != null)
593 { 549 shared = module is ISharedRegionModule;
594 if (mod is IRegionModule)
595 {
596 IRegionModule module = (IRegionModule)mod;
597 shared = module.IsSharedModule;
598 }
599 else if (mod is IRegionModuleBase)
600 {
601 shared = mod is ISharedRegionModule;
602 }
603 else
604 {
605 throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
606 }
607 }
608 550
609 MainConsole.Instance.Commands.AddCommand( 551 MainConsole.Instance.Commands.AddCommand(
610 category, shared, command, shorthelp, longhelp, descriptivehelp, callback); 552 category, shared, command, shorthelp, longhelp, descriptivehelp, callback);