aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneBase.cs
diff options
context:
space:
mode:
authorMelanie2012-11-12 22:50:28 +0000
committerMelanie2012-11-12 22:50:28 +0000
commit8c130bcaf5a60fa042d8df38ba1d1e1cb328d768 (patch)
treec96ae7dcf06cf6f6b4efba25bb0a37e55c053fce /OpenSim/Region/Framework/Scenes/SceneBase.cs
parentRemove IRegionModule support from the test setup helper (diff)
downloadopensim-SC_OLD-8c130bcaf5a60fa042d8df38ba1d1e1cb328d768.zip
opensim-SC_OLD-8c130bcaf5a60fa042d8df38ba1d1e1cb328d768.tar.gz
opensim-SC_OLD-8c130bcaf5a60fa042d8df38ba1d1e1cb328d768.tar.bz2
opensim-SC_OLD-8c130bcaf5a60fa042d8df38ba1d1e1cb328d768.tar.xz
Remove the old style module loader and all references to it
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 b87a38a..d3e968e 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; }
@@ -272,16 +266,6 @@ namespace OpenSim.Region.Framework.Scenes
272 /// </summary> 266 /// </summary>
273 public virtual void Close() 267 public virtual void Close()
274 { 268 {
275 // Shut down all non shared modules.
276 foreach (IRegionModule module in Modules.Values)
277 {
278 if (!module.IsSharedModule)
279 {
280 module.Close();
281 }
282 }
283 Modules.Clear();
284
285 try 269 try
286 { 270 {
287 EventManager.TriggerShutdown(); 271 EventManager.TriggerShutdown();
@@ -312,19 +296,6 @@ namespace OpenSim.Region.Framework.Scenes
312 #region Module Methods 296 #region Module Methods
313 297
314 /// <summary> 298 /// <summary>
315 /// Add a module to this scene.
316 /// </summary>
317 /// <param name="name"></param>
318 /// <param name="module"></param>
319 public void AddModule(string name, IRegionModule module)
320 {
321 if (!Modules.ContainsKey(name))
322 {
323 Modules.Add(name, module);
324 }
325 }
326
327 /// <summary>
328 /// Add a region-module to this scene. TODO: This will replace AddModule in the future. 299 /// Add a region-module to this scene. TODO: This will replace AddModule in the future.
329 /// </summary> 300 /// </summary>
330 /// <param name="name"></param> 301 /// <param name="name"></param>
@@ -508,9 +479,9 @@ namespace OpenSim.Region.Framework.Scenes
508 /// <param name="shorthelp"></param> 479 /// <param name="shorthelp"></param>
509 /// <param name="longhelp"></param> 480 /// <param name="longhelp"></param>
510 /// <param name="callback"></param> 481 /// <param name="callback"></param>
511 public void AddCommand(object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) 482 public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback)
512 { 483 {
513 AddCommand(mod, command, shorthelp, longhelp, string.Empty, callback); 484 AddCommand(module, command, shorthelp, longhelp, string.Empty, callback);
514 } 485 }
515 486
516 /// <summary> 487 /// <summary>
@@ -528,9 +499,9 @@ namespace OpenSim.Region.Framework.Scenes
528 /// <param name="longhelp"></param> 499 /// <param name="longhelp"></param>
529 /// <param name="callback"></param> 500 /// <param name="callback"></param>
530 public void AddCommand( 501 public void AddCommand(
531 string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback) 502 string category, IRegionModuleBase module, string command, string shorthelp, string longhelp, CommandDelegate callback)
532 { 503 {
533 AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback); 504 AddCommand(category, module, command, shorthelp, longhelp, string.Empty, callback);
534 } 505 }
535 506
536 /// <summary> 507 /// <summary>
@@ -542,29 +513,14 @@ namespace OpenSim.Region.Framework.Scenes
542 /// <param name="longhelp"></param> 513 /// <param name="longhelp"></param>
543 /// <param name="descriptivehelp"></param> 514 /// <param name="descriptivehelp"></param>
544 /// <param name="callback"></param> 515 /// <param name="callback"></param>
545 public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) 516 public void AddCommand(IRegionModuleBase module, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
546 { 517 {
547 string moduleName = ""; 518 string moduleName = "";
548 519
549 if (mod != null) 520 if (module != null)
550 { 521 moduleName = module.Name;
551 if (mod is IRegionModule)
552 {
553 IRegionModule module = (IRegionModule)mod;
554 moduleName = module.Name;
555 }
556 else if (mod is IRegionModuleBase)
557 {
558 IRegionModuleBase module = (IRegionModuleBase)mod;
559 moduleName = module.Name;
560 }
561 else
562 {
563 throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
564 }
565 }
566 522
567 AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback); 523 AddCommand(moduleName, module, command, shorthelp, longhelp, descriptivehelp, callback);
568 } 524 }
569 525
570 /// <summary> 526 /// <summary>
@@ -580,7 +536,7 @@ namespace OpenSim.Region.Framework.Scenes
580 /// <param name="descriptivehelp"></param> 536 /// <param name="descriptivehelp"></param>
581 /// <param name="callback"></param> 537 /// <param name="callback"></param>
582 public void AddCommand( 538 public void AddCommand(
583 string category, object mod, string command, 539 string category, IRegionModuleBase module, string command,
584 string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback) 540 string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
585 { 541 {
586 if (MainConsole.Instance == null) 542 if (MainConsole.Instance == null)
@@ -588,22 +544,8 @@ namespace OpenSim.Region.Framework.Scenes
588 544
589 bool shared = false; 545 bool shared = false;
590 546
591 if (mod != null) 547 if (module != null)
592 { 548 shared = module is ISharedRegionModule;
593 if (mod is IRegionModule)
594 {
595 IRegionModule module = (IRegionModule)mod;
596 shared = module.IsSharedModule;
597 }
598 else if (mod is IRegionModuleBase)
599 {
600 shared = mod is ISharedRegionModule;
601 }
602 else
603 {
604 throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
605 }
606 }
607 549
608 MainConsole.Instance.Commands.AddCommand( 550 MainConsole.Instance.Commands.AddCommand(
609 category, shared, command, shorthelp, longhelp, descriptivehelp, callback); 551 category, shared, command, shorthelp, longhelp, descriptivehelp, callback);