aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs56
1 files changed, 33 insertions, 23 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index ec3193c..c5ee385 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{
@@ -195,6 +196,24 @@ namespace OpenSim
195 m_permsModules = new List<string>(permissionModules.Split(',')); 196 m_permsModules = new List<string>(permissionModules.Split(','));
196 } 197 }
197 198
199 // Load the simulation data service
200 IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"];
201 if (simDataConfig == null)
202 throw new Exception("Configuration file is missing the [SimulationDataStore] section");
203 string module = simDataConfig.GetString("LocalServiceModule", String.Empty);
204 if (String.IsNullOrEmpty(module))
205 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section");
206 m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source });
207
208 // Load the estate data service
209 IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"];
210 if (estateDataConfig == null)
211 throw new Exception("Configuration file is missing the [EstateDataStore] section");
212 module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
213 if (String.IsNullOrEmpty(module))
214 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section");
215 m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { m_config.Source });
216
198 base.StartupSpecific(); 217 base.StartupSpecific();
199 218
200 m_stats = StatsManager.StartCollectingSimExtraStats(); 219 m_stats = StatsManager.StartCollectingSimExtraStats();
@@ -612,7 +631,7 @@ namespace OpenSim
612 631
613 regionInfo.InternalEndPoint.Port = (int) port; 632 regionInfo.InternalEndPoint.Port = (int) port;
614 633
615 Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager); 634 Scene scene = CreateScene(regionInfo, m_simulationDataService, m_estateDataService, circuitManager);
616 635
617 if (m_autoCreateClientStack) 636 if (m_autoCreateClientStack)
618 { 637 {
@@ -628,30 +647,19 @@ namespace OpenSim
628 return scene; 647 return scene;
629 } 648 }
630 649
631 protected override StorageManager CreateStorageManager()
632 {
633 return
634 CreateStorageManager(m_configSettings.StorageConnectionString, m_configSettings.EstateConnectionString);
635 }
636
637 protected StorageManager CreateStorageManager(string connectionstring, string estateconnectionstring)
638 {
639 return new StorageManager(m_configSettings.StorageDll, connectionstring, estateconnectionstring);
640 }
641
642 protected override ClientStackManager CreateClientStackManager() 650 protected override ClientStackManager CreateClientStackManager()
643 { 651 {
644 return new ClientStackManager(m_configSettings.ClientstackDll); 652 return new ClientStackManager(m_configSettings.ClientstackDll);
645 } 653 }
646 654
647 protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, 655 protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService,
648 AgentCircuitManager circuitManager) 656 IEstateDataService estateDataService, AgentCircuitManager circuitManager)
649 { 657 {
650 SceneCommunicationService sceneGridService = new SceneCommunicationService(); 658 SceneCommunicationService sceneGridService = new SceneCommunicationService();
651 659
652 return new Scene( 660 return new Scene(
653 regionInfo, circuitManager, sceneGridService, 661 regionInfo, circuitManager, sceneGridService,
654 storageManager, m_moduleLoader, false, m_configSettings.PhysicalPrim, 662 simDataService, estateDataService, m_moduleLoader, false, m_configSettings.PhysicalPrim,
655 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version); 663 m_configSettings.See_into_region_from_neighbor, m_config.Source, m_version);
656 } 664 }
657 665
@@ -868,21 +876,23 @@ namespace OpenSim
868 /// </param> 876 /// </param>
869 public void PopulateRegionEstateInfo(RegionInfo regInfo) 877 public void PopulateRegionEstateInfo(RegionInfo regInfo)
870 { 878 {
871 if (m_storageManager.EstateDataStore != null) 879 IEstateDataService estateDataService = EstateDataService;
880
881 if (estateDataService != null)
872 { 882 {
873 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, false); 883 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, false);
874 } 884 }
875 885
876 if (regInfo.EstateSettings.EstateID == 0) // No record at all 886 if (regInfo.EstateSettings.EstateID == 0) // No record at all
877 { 887 {
878 MainConsole.Instance.Output("Your region is not part of an estate."); 888 MainConsole.Instance.Output("Your region is not part of an estate.");
879 while (true) 889 while (true)
880 { 890 {
881 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"}); 891 string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() { "yes", "no" });
882 if (response == "no") 892 if (response == "no")
883 { 893 {
884 // Create a new estate 894 // Create a new estate
885 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(regInfo.RegionID, true); 895 regInfo.EstateSettings = estateDataService.LoadEstateSettings(regInfo.RegionID, true);
886 896
887 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName); 897 regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
888 //regInfo.EstateSettings.Save(); 898 //regInfo.EstateSettings.Save();
@@ -894,7 +904,7 @@ namespace OpenSim
894 if (response == "None") 904 if (response == "None")
895 continue; 905 continue;
896 906
897 List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response); 907 List<int> estateIDs = estateDataService.GetEstates(response);
898 if (estateIDs.Count < 1) 908 if (estateIDs.Count < 1)
899 { 909 {
900 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again"); 910 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
@@ -903,9 +913,9 @@ namespace OpenSim
903 913
904 int estateID = estateIDs[0]; 914 int estateID = estateIDs[0];
905 915
906 regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID); 916 regInfo.EstateSettings = estateDataService.LoadEstateSettings(estateID);
907 917
908 if (m_storageManager.EstateDataStore.LinkRegion(regInfo.RegionID, estateID)) 918 if (estateDataService.LinkRegion(regInfo.RegionID, estateID))
909 break; 919 break;
910 920
911 MainConsole.Instance.Output("Joining the estate failed. Please try again."); 921 MainConsole.Instance.Output("Joining the estate failed. Please try again.");