aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-11-12 23:27:47 +0000
committerMelanie2012-11-12 23:27:47 +0000
commit2e0ce70e639391ecec9d63d88c6d8910e3b0ebfc (patch)
tree308caeac8741ef507a3f02f41d4403a29d06b06e /OpenSim/Region/Framework/Scenes
parentMerge branch 'master' into careminster (diff)
parentCompletely remove the IRegionModule interface (diff)
downloadopensim-SC-2e0ce70e639391ecec9d63d88c6d8910e3b0ebfc.zip
opensim-SC-2e0ce70e639391ecec9d63d88c6d8910e3b0ebfc.tar.gz
opensim-SC-2e0ce70e639391ecec9d63d88c6d8910e3b0ebfc.tar.bz2
opensim-SC-2e0ce70e639391ecec9d63d88c6d8910e3b0ebfc.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Application/OpenSimBase.cs OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs OpenSim/Region/Framework/ModuleLoader.cs OpenSim/Region/Framework/Scenes/SceneManager.cs
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.cs25
3 files changed, 12 insertions, 97 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2543333..80d9f6e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -177,7 +177,6 @@ namespace OpenSim.Region.Framework.Scenes
177 protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); 177 protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>();
178 protected List<RegionInfo> m_neighbours = new List<RegionInfo>(); 178 protected List<RegionInfo> m_neighbours = new List<RegionInfo>();
179 protected string m_simulatorVersion = "OpenSimulator Server"; 179 protected string m_simulatorVersion = "OpenSimulator Server";
180 protected ModuleLoader m_moduleLoader;
181 protected AgentCircuitManager m_authenticateHandler; 180 protected AgentCircuitManager m_authenticateHandler;
182 protected SceneCommunicationService m_sceneGridService; 181 protected SceneCommunicationService m_sceneGridService;
183 protected ISnmpModule m_snmpService = null; 182 protected ISnmpModule m_snmpService = null;
@@ -679,7 +678,7 @@ namespace OpenSim.Region.Framework.Scenes
679 public Scene(RegionInfo regInfo, AgentCircuitManager authen, 678 public Scene(RegionInfo regInfo, AgentCircuitManager authen,
680 SceneCommunicationService sceneGridService, 679 SceneCommunicationService sceneGridService,
681 ISimulationDataService simDataService, IEstateDataService estateDataService, 680 ISimulationDataService simDataService, IEstateDataService estateDataService,
682 ModuleLoader moduleLoader, bool dumpAssetsToFile, 681 bool dumpAssetsToFile,
683 IConfigSource config, string simulatorVersion) 682 IConfigSource config, string simulatorVersion)
684 : this(regInfo) 683 : this(regInfo)
685 { 684 {
@@ -690,7 +689,6 @@ namespace OpenSim.Region.Framework.Scenes
690 Random random = new Random(); 689 Random random = new Random();
691 690
692 m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); 691 m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4);
693 m_moduleLoader = moduleLoader;
694 m_authenticateHandler = authen; 692 m_authenticateHandler = authen;
695 m_sceneGridService = sceneGridService; 693 m_sceneGridService = sceneGridService;
696 m_SimulationDataService = simDataService; 694 m_SimulationDataService = simDataService;
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);
diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs
index dba3a61..89e3ac5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs
@@ -138,31 +138,6 @@ namespace OpenSim.Region.Framework.Scenes
138 138
139 public void Close() 139 public void Close()
140 { 140 {
141 // collect known shared modules in sharedModules
142 Dictionary<string, IRegionModule> sharedModules = new Dictionary<string, IRegionModule>();
143
144 List<Scene> sceneList = Scenes;
145 for (int i = 0; i < sceneList.Count; i++)
146 {
147 // extract known shared modules from scene
148 foreach (string k in sceneList[i].Modules.Keys)
149 {
150 if (sceneList[i].Modules[k].IsSharedModule &&
151 !sharedModules.ContainsKey(k))
152 sharedModules[k] = sceneList[i].Modules[k];
153 }
154 // close scene/region
155 sceneList[i].Close();
156 }
157
158 // all regions/scenes are now closed, we can now safely
159 // close all shared modules
160 foreach (IRegionModule mod in sharedModules.Values)
161 {
162 mod.Close();
163 }
164
165 m_localScenes.Clear();
166 } 141 }
167 142
168 public void Close(Scene cscene) 143 public void Close(Scene cscene)