aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs80
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneManager.cs16
3 files changed, 12 insertions, 88 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 69c1027..db45d6b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -176,7 +176,6 @@ namespace OpenSim.Region.Framework.Scenes
176 protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); 176 protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
177 protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); 177 protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
178 protected string m_simulatorVersion = "OpenSimulator Server"; 178 protected string m_simulatorVersion = "OpenSimulator Server";
179 protected ModuleLoader m_moduleLoader;
180 protected AgentCircuitManager m_authenticateHandler; 179 protected AgentCircuitManager m_authenticateHandler;
181 protected SceneCommunicationService m_sceneGridService; 180 protected SceneCommunicationService m_sceneGridService;
182 181
@@ -659,7 +658,7 @@ namespace OpenSim.Region.Framework.Scenes
659 public Scene(RegionInfo regInfo, AgentCircuitManager authen, 658 public Scene(RegionInfo regInfo, AgentCircuitManager authen,
660 SceneCommunicationService sceneGridService, 659 SceneCommunicationService sceneGridService,
661 ISimulationDataService simDataService, IEstateDataService estateDataService, 660 ISimulationDataService simDataService, IEstateDataService estateDataService,
662 ModuleLoader moduleLoader, bool dumpAssetsToFile, 661 bool dumpAssetsToFile,
663 IConfigSource config, string simulatorVersion) 662 IConfigSource config, string simulatorVersion)
664 : this(regInfo) 663 : this(regInfo)
665 { 664 {
@@ -670,7 +669,6 @@ namespace OpenSim.Region.Framework.Scenes
670 Random random = new Random(); 669 Random random = new Random();
671 670
672 m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); 671 m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4);
673 m_moduleLoader = moduleLoader;
674 m_authenticateHandler = authen; 672 m_authenticateHandler = authen;
675 m_sceneGridService = sceneGridService; 673 m_sceneGridService = sceneGridService;
676 m_SimulationDataService = simDataService; 674 m_SimulationDataService = simDataService;
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);
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index cb5b2ba..992e71d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -144,22 +144,6 @@ namespace OpenSim.Region.Framework.Scenes
144 // collect known shared modules in sharedModules 144 // collect known shared modules in sharedModules
145 Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>(); 145 Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
146 146
147 lock (m_localScenes)
148 {
149 for (int i = 0; i < m_localScenes.Count; i++)
150 {
151 // extract known shared modules from scene
152 foreach (string k in m_localScenes[i].Modules.Keys)
153 {
154 if (m_localScenes[i].Modules[k].IsSharedModule &&
155 !sharedModules.ContainsKey(k))
156 sharedModules[k] = m_localScenes[i].Modules[k];
157 }
158 // close scene/region
159 m_localScenes[i].Close();
160 }
161 }
162
163 // all regions/scenes are now closed, we can now safely 147 // all regions/scenes are now closed, we can now safely
164 // close all shared modules 148 // close all shared modules
165 foreach (IRegionModule mod in sharedModules.Values) 149 foreach (IRegionModule mod in sharedModules.Values)