aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/ConfigurationLoader.cs4
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs56
2 files changed, 33 insertions, 27 deletions
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs
index e69e3fc..e2e0640 100644
--- a/OpenSim/Region/Application/ConfigurationLoader.cs
+++ b/OpenSim/Region/Application/ConfigurationLoader.cs
@@ -345,10 +345,6 @@ namespace OpenSim
345 345
346 m_configSettings.StorageDll = startupConfig.GetString("storage_plugin"); 346 m_configSettings.StorageDll = startupConfig.GetString("storage_plugin");
347 347
348 m_configSettings.StorageConnectionString
349 = startupConfig.GetString("storage_connection_string");
350 m_configSettings.EstateConnectionString
351 = startupConfig.GetString("estate_connection_string", m_configSettings.StorageConnectionString);
352 m_configSettings.ClientstackDll 348 m_configSettings.ClientstackDll
353 = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll"); 349 = startupConfig.GetString("clientstack_plugin", "OpenSim.Region.ClientStack.LindenUDP.dll");
354 } 350 }
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index d2d2607..74ad168 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -45,6 +45,7 @@ using OpenSim.Region.Framework;
45using OpenSim.Region.Framework.Interfaces; 45using OpenSim.Region.Framework.Interfaces;
46using OpenSim.Region.Framework.Scenes; 46using OpenSim.Region.Framework.Scenes;
47using OpenSim.Region.Physics.Manager; 47using OpenSim.Region.Physics.Manager;
48using OpenSim.Server.Base;
48 49
49namespace OpenSim 50namespace OpenSim
50{ 51{
@@ -186,6 +187,24 @@ namespace OpenSim
186 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 187 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
187 } 188 }
188 189
190 // Load the simulation data service
191 IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"];
192 if (simDataConfig == null)
193 throw new Exception("Configuration file is missing the [SimulationDataStore] section");
194 string module = simDataConfig.GetString("LocalServiceModule", String.Empty);
195 if (String.IsNullOrEmpty(module))
196 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section");
197 m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source });
198
199 // Load the estate data service
200 IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"];
201 if (estateDataConfig == null)
202 throw new Exception("Configuration file is missing the [EstateDataStore] section");
203 module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
204 if (String.IsNullOrEmpty(module))
205 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section");
206 m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { m_config.Source });
207
189 base.StartupSpecific(); 208 base.StartupSpecific();
190 209
191 m_stats = StatsManager.StartCollectingSimExtraStats(); 210 m_stats = StatsManager.StartCollectingSimExtraStats();
@@ -536,7 +555,7 @@ namespace OpenSim
536 555
537 regionInfo.InternalEndPoint.Port = (int) port; 556 regionInfo.InternalEndPoint.Port = (int) port;
538 557
539 Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); 558 Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager);
540 559
541 if (m_autoCreateClientStack) 560 if (m_autoCreateClientStack)
542 { 561 {
@@ -552,30 +571,19 @@ namespace OpenSim
552 return scene; 571 return scene;
553 } 572 }
554 573
555 protected override StorageManager CreateStorageManager()
556 {
557 return
558 CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString);
559 }
560
561 protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring)
562 {
563 return new StorageManager(m_configSettings.StorageDll, connectionstring, estateconnectionstring);
564 }
565
566 protected override ClientStackManager CreateClientStackManager() 574 protected override ClientStackManager CreateClientStackManager()
567 { 575 {
568 return new ClientStackManager(m_configSettings.ClientstackDll); 576 return new ClientStackManager(m_configSettings.ClientstackDll);
569 } 577 }
570 578
571 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, 579 protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
572 AgentCircuitManager circuitManager) 580 IEstateDataService estateDataService, AgentCircuitManager circuitManager)
573 { 581 {
574 SceneCommunicationService sceneGridService = new SceneCommunicationService(); 582 SceneCommunicationService sceneGridService = new SceneCommunicationService();
575 583
576 return new Scene( 584 return new Scene(
577 regionInfo, circuitManager, sceneGridService, 585 regionInfo, circuitManager, sceneGridService,
578 storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, 586 simDataService, estateDataService, m_moduleLoader, false, m_configSettings.PhysicalPrim,
579 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 587 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
580 } 588 }
581 589
@@ -792,21 +800,23 @@ namespace OpenSim
792 /// </param> 800 /// </param>
793 public void PopulateRegionEstateInfo(RegionInfo regInfo) 801 public void PopulateRegionEstateInfo(RegionInfo regInfo)
794 { 802 {
795 if (m_storageManager.EstateDataStore != null) 803 IEstateDataService estateDataService = EstateDataService;
804
805 if (estateDataService != null)
796 { 806 {
797 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false); 807 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, false);
798 } 808 }
799 809
800 if (regInfo.EstateSettings.EstateID == 0) // No record at all 810 if (regInfo.EstateSettings.EstateID == 0) // No record at all
801 { 811 {
802 MainConsole.Instance.Output("Your region is not part of an estate."); 812 MainConsole.Instance.Output("Your region is not part of an estate.");
803 while (true) 813 while (true)
804 { 814 {
805 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"}); 815 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() { "yes", "no" });
806 if (response == "no") 816 if (response == "no")
807 { 817 {
808 // Create a new estate 818 // Create a new estate
809 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true); 819 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true);
810 820
811 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); 821 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
812 //regInfo.EstateSettings.Save(); 822 //regInfo.EstateSettings.Save();
@@ -818,7 +828,7 @@ namespace OpenSim
818 if (response == "None") 828 if (response == "None")
819 continue; 829 continue;
820 830
821 List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response); 831 List<int> estateIDs = estateDataService.GetEstates(response);
822 if (estateIDs.Count < 1) 832 if (estateIDs.Count < 1)
823 { 833 {
824 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); 834 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
@@ -827,9 +837,9 @@ namespace OpenSim
827 837
828 int estateID = estateIDs[0]; 838 int estateID = estateIDs[0];
829 839
830 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); 840 regInfo.EstateSettings = estateDataService.LoadEstateSettings(estateID);
831 841
832 if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID)) 842 if (estateDataService.LinkRegion(regInfo.RegionID, estateID))
833 break; 843 break;
834 844
835 MainConsole.Instance.Output("Joining the estate failed. Please try again."); 845 MainConsole.Instance.Output("Joining the estate failed. Please try again.");